Skip to content

Commit

Permalink
Fixing checkbox spacing & accessibility, ref #10617
Browse files Browse the repository at this point in the history
Signed-off-by: Jan C. Borchardt <hey@jancborchardt.net>
  • Loading branch information
jancborchardt committed Aug 21, 2020
1 parent e212862 commit 8fb2ef1
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 11 deletions.
14 changes: 9 additions & 5 deletions apps/files/css/files.scss
Original file line number Diff line number Diff line change
Expand Up @@ -459,16 +459,20 @@ table td.selection {
}

/* File checkboxes */
#fileList tr td.selection>.selectCheckBox + label:before {
#filestable th #select_all_files + label:before,
#fileList tr td.selection > .selectCheckBox + label:before {
opacity: 0.3;
margin-right: 0;
}

/* Show checkbox with full opacity when hovering, checked, or selected */
#fileList tr:hover td.selection>.selectCheckBox + label:before,
#fileList tr:focus td.selection>.selectCheckBox + label:before,
#fileList tr td.selection>.selectCheckBox:checked + label:before,
#fileList tr.selected td.selection>.selectCheckBox + label:before {
#filestable th:hover #select_all_files + label:before,
#filestable th #select_all_files:focus + label:before,
#filestable th #select_all_files:checked + label:before,
#fileList tr:hover td.selection > .selectCheckBox + label:before,
#fileList tr td.selection > .selectCheckBox:focus + label:before,
#fileList tr td.selection > .selectCheckBox:checked + label:before,
#fileList tr.selected td.selection > .selectCheckBox + label:before {
opacity: 1;
}

Expand Down
12 changes: 12 additions & 0 deletions apps/settings/css/settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,18 @@ span.version {
display: inline-block;
}
}

input {
&[type='checkbox'],
&[type='radio'] {
&.radio,
&.checkbox {
+ label {
line-height: 44px;
}
}
}
}
}

.personal-settings-setting-box .section {
Expand Down
2 changes: 1 addition & 1 deletion core/css/apps.scss
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ $min-content-width: $breakpoint-mobile - $navigation-width - $list-min-width;
+ label {
display: inline-block;
width: 100%;
padding: 5px 0;
line-height: 44px;
}
}
}
Expand Down
17 changes: 12 additions & 5 deletions core/css/inputs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -358,14 +358,21 @@ input {
height: $checkbox-radio-size;
width: $checkbox-radio-size;
vertical-align: middle;
border-radius: 50%;
margin: 0 6px 3px 3px;
border-radius: var(--border-radius-pill);
margin: 0 13px 2px 4px;
border: 1px solid $color-checkbox-radio-border;
}
&:not(:disabled):not(:checked) + label:hover:before,

&:not(:disabled) + label:hover:before,
&:focus + label:before {
border-color: var(--color-primary-element);
box-shadow: 0 0 0 2px var(--color-text-maxcontrast) !important;
}

&:not(:disabled):not(:checked) + label:hover:before,
&:focus:not(:checked) + label:before {
box-shadow: 0 0 0 2px var(--color-primary-element) !important;
}

&:checked + label:before,
&.checkbox:indeterminate + label:before {
/* ^ :indeterminate have a strange behavior on radio,
Expand Down Expand Up @@ -393,7 +400,7 @@ input {
}
&.checkbox {
+ label:before {
border-radius: 1px;
border-radius: var(--border-radius);
height: $checkbox-radio-size;
width: $checkbox-radio-size;
box-shadow: none !important;
Expand Down

0 comments on commit 8fb2ef1

Please sign in to comment.