|
14 | 14 | display: inline-block; |
15 | 15 |
|
16 | 16 | // The ripple needs extra specificity so the base ripple styling doesn't override its `position`. |
17 | | - .mat-mdc-slide-toggle-ripple, .mdc-switch__thumb-underlay::before { |
| 17 | + .mat-mdc-slide-toggle-ripple, .mdc-switch__thumb-underlay::after { |
18 | 18 | @include mat-fill; |
19 | 19 |
|
20 | 20 | // Disable pointer events for the ripple container so that it doesn't eat the mouse events meant |
|
26 | 26 | // The MDC switch styles related to the hover state are intertwined with the MDC ripple styles. |
27 | 27 | // We currently don't use the MDC ripple due to size concerns, therefore we need to add some |
28 | 28 | // additional styles to restore the hover state. |
29 | | - .mdc-switch__thumb-underlay::before { |
| 29 | + // We use `::after`, rather than `::before`, because `::before` is used by the |
| 30 | + // generic strong focus indication styles. |
| 31 | + .mdc-switch__thumb-underlay::after { |
30 | 32 | border-radius: 50%; |
31 | 33 | content: ''; |
32 | 34 | opacity: 0; |
33 | 35 | } |
34 | 36 |
|
35 | | - .mdc-switch:hover .mdc-switch__thumb-underlay::before { |
| 37 | + .mdc-switch:hover .mdc-switch__thumb-underlay::after { |
36 | 38 | opacity: map-get($mdc-ripple-dark-ink-opacities, hover); |
37 | 39 | transition: mdc-switch-transition-enter(opacity, 0, 75ms); |
38 | 40 | } |
39 | 41 |
|
40 | 42 | // Needs a little more specificity so the :hover styles don't override it. |
41 | | - &.mat-mdc-slide-toggle-focused .mdc-switch .mdc-switch__thumb-underlay::before { |
| 43 | + &.mat-mdc-slide-toggle-focused .mdc-switch .mdc-switch__thumb-underlay::after { |
42 | 44 | opacity: map-get($mdc-ripple-dark-ink-opacities, focus); |
43 | 45 | } |
44 | 46 |
|
|
57 | 59 | // conditionally add them. Consider the size cost when deciding whether to switch. |
58 | 60 | &._mat-animation-noopable { |
59 | 61 | .mdc-switch__thumb-underlay, |
60 | | - .mdc-switch__thumb-underlay::before { |
| 62 | + .mdc-switch__thumb-underlay::after { |
61 | 63 | transition: none; |
62 | 64 | } |
63 | 65 | } |
|
0 commit comments