Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
fix(checkbox): Fixed disabled checkbox styles for Edge browser (#4602)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalerba authored and abhiomkar committed Apr 23, 2019
1 parent 7d4124d commit 7855a6b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/mdc-checkbox/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,11 @@
}

@mixin mdc-checkbox-unmarked-background-selector-disabled_ {
// Note: we must use `[disabled]` instead of `:disabled` below because Edge does not always recalculate the style
// property when the `:disabled` pseudo-class is followed by a sibling combinator. See:
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11295231/
// stylelint-disable-next-line selector-max-specificity
.mdc-checkbox__native-control:disabled:not(:checked):not(:indeterminate) ~ .mdc-checkbox__background {
.mdc-checkbox__native-control[disabled]:not(:checked):not(:indeterminate) ~ .mdc-checkbox__background {
@content;
}
}
Expand All @@ -438,8 +441,11 @@
}

@mixin mdc-checkbox-marked-background-selector-disabled_ {
.mdc-checkbox__native-control:disabled:checked ~ .mdc-checkbox__background,
.mdc-checkbox__native-control:disabled:indeterminate ~ .mdc-checkbox__background {
// Note: we must use `[disabled]` instead of `:disabled` below because Edge does not always recalculate the style
// property when the `:disabled` pseudo-class is followed by a sibling combinator. See:
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11295231/
.mdc-checkbox__native-control[disabled]:checked ~ .mdc-checkbox__background,
.mdc-checkbox__native-control[disabled]:indeterminate ~ .mdc-checkbox__background {
@content;
}
}
Expand Down

0 comments on commit 7855a6b

Please sign in to comment.