|
4 | 4 | @use 'sass:map';
|
5 | 5 | @use '../mdc-helpers/mdc-helpers';
|
6 | 6 | @use '../../material/core/style/_layout-common.scss';
|
| 7 | +@use '../../cdk/a11y/a11y'; |
7 | 8 | @import '@material/checkbox/functions.import';
|
8 | 9 | @import '@material/checkbox/mixins.import';
|
9 | 10 | @import '@material/form-field/mixins.import';
|
|
27 | 28 | // The MDC checkbox styles related to the hover state are intertwined with the MDC ripple styles.
|
28 | 29 | // We currently don't use the MDC ripple due to size concerns, therefore we need to add some
|
29 | 30 | // additional styles to restore the hover state.
|
30 |
| - .mdc-checkbox:hover |
31 |
| - .mdc-checkbox__native-control:not([disabled]) ~ .mdc-checkbox__ripple { |
| 31 | + .mdc-checkbox:hover .mdc-checkbox__native-control:not([disabled]) ~ .mdc-checkbox__ripple { |
32 | 32 | opacity: map.get($mdc-ripple-dark-ink-opacities, hover);
|
33 | 33 | transform: scale(1);
|
34 | 34 | transition: mdc-checkbox-transition-enter(opacity, 0, 80ms),
|
|
37 | 37 |
|
38 | 38 | // Note that the :not([disabled]) here isn't necessary, but we need it for the
|
39 | 39 | // extra specificity so that the hover styles don't override the focus styles.
|
40 |
| - .mdc-checkbox |
41 |
| - .mdc-checkbox__native-control:not([disabled]):focus ~ .mdc-checkbox__ripple { |
| 40 | + .mdc-checkbox .mdc-checkbox__native-control:not([disabled]):focus ~ .mdc-checkbox__ripple { |
42 | 41 | opacity: map.get($mdc-ripple-dark-ink-opacities, hover) +
|
43 | 42 | map.get($mdc-ripple-dark-ink-opacities, focus);
|
| 43 | + |
| 44 | + @include a11y.high-contrast(active, off) { |
| 45 | + outline: solid 3px; |
| 46 | + opacity: 1; |
| 47 | + } |
44 | 48 | }
|
45 | 49 |
|
46 | 50 | // Angular Material supports disabling all animations when NoopAnimationsModule is imported.
|
|
0 commit comments