Skip to content

Commit

Permalink
fix(material/checkbox): disabled state not distinguishable in high co…
Browse files Browse the repository at this point in the history
…ntrast mode (#25788)

Fixes that disabled checkboxes aren't distinguishable from enabled ones in high contrast mode. I also fixed an issue where the checkmark wasn't visible, but I suspect that it's only a problem when emulating on a Chromium browser.
  • Loading branch information
crisbeto committed Oct 11, 2022
1 parent 87eb708 commit 8a1cf8c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/material/checkbox/checkbox.scss
@@ -1,3 +1,4 @@
@use '@angular/cdk';
@use '@material/checkbox/checkbox' as mdc-checkbox;
@use '@material/checkbox/checkbox-theme' as mdc-checkbox-theme;
@use '@material/form-field' as mdc-form-field;
Expand Down Expand Up @@ -98,6 +99,17 @@
}
}

@include cdk.high-contrast(active, off) {
&.mat-mdc-checkbox-disabled {
opacity: 0.5;
}

.mdc-checkbox__checkmark {
--mdc-checkbox-selected-checkmark-color: CanvasText;
--mdc-checkbox-disabled-selected-checkmark-color: CanvasText;
}
}

@include _ripple-base-styles();
}

Expand Down

0 comments on commit 8a1cf8c

Please sign in to comment.