@@ -8,6 +8,13 @@ $_interactive-disabled-selector: '.mat-mdc-slide-toggle-disabled-interactive.mdc
88
99$fallbacks : m3-slide-toggle .get-tokens ();
1010
11+ [matCheckedIcon ],
12+ [matUncheckedIcon ],
13+ [matCheckedDisabledIcon ],
14+ [matUncheckedDisabledIcon ] {
15+   display none ;
16+ }
17+ 
1118.mdc-switch  {
1219  align-items center ;
1320  background none ;
@@ -66,9 +73,13 @@ $fallbacks: m3-slide-toggle.get-tokens();
6673
6774    .mdc-switch--disabled  &  {
6875      border-width token-utils .slot (
69-           slide-toggle-disabled-unselected-track-outline-width , $fallbacks );
76+         slide-toggle-disabled-unselected-track-outline-width ,
77+         $fallbacks 
78+       );
7079      border-color token-utils .slot (
71-           slide-toggle-disabled-unselected-track-outline-color , $fallbacks );
80+         slide-toggle-disabled-unselected-track-outline-color ,
81+         $fallbacks 
82+       );
7283    }
7384  }
7485
@@ -223,7 +234,9 @@ $fallbacks: m3-slide-toggle.get-tokens();
223234
224235    & :has (.mdc-switch__icons ) {
225236      margin token-utils .slot (
226-           slide-toggle-unselected-with-icon-handle-horizontal-margin , $fallbacks );
237+         slide-toggle-unselected-with-icon-handle-horizontal-margin ,
238+         $fallbacks 
239+       );
227240    }
228241  }
229242
@@ -234,7 +247,9 @@ $fallbacks: m3-slide-toggle.get-tokens();
234247
235248    & :has (.mdc-switch__icons ) {
236249      margin token-utils .slot (
237-           slide-toggle-selected-with-icon-handle-horizontal-margin , $fallbacks );
250+         slide-toggle-selected-with-icon-handle-horizontal-margin ,
251+         $fallbacks 
252+       );
238253    }
239254  }
240255
@@ -275,7 +290,8 @@ $fallbacks: m3-slide-toggle.get-tokens();
275290    left 0 ;
276291    position absolute ;
277292    top 0 ;
278-     transition background-color  75ms   0ms   cubic-bezier (0.4 , 0 , 0.2 , 1 ),
293+     transition 
294+       background-color  75ms   0ms   cubic-bezier (0.4 , 0 , 0.2 , 1 ),
279295      border-color  75ms   0ms   cubic-bezier (0.4 , 0 , 0.2 , 1 );
280296    z-index -1 ;
281297
@@ -435,39 +451,50 @@ $fallbacks: m3-slide-toggle.get-tokens();
435451  }
436452}
437453
438- .mdc-switch__icon  {
439-   bottom 0 ;
440-   left 0 ;
441-   margin auto ;
454+ .mdc-switch__icons  > [matUncheckedIcon ],
455+ .mdc-switch__icons  > [matCheckedIcon ],
456+ .mdc-switch__icons  > [matUncheckedDisabledIcon ],
457+ .mdc-switch__icons  > [matCheckedDisabledIcon ] {
458+   margin 0 ;
442459  position absolute ;
443-   right 0 ;
444-   top 0 ;
460+   top 50%  ;
461+   right 50%  ;
462+   transform translate (50%  , -50%  );
445463  opacity 0 ;
464+   font-size 16px  ;
465+   display block ;
466+ 
446467  transition opacity  30ms   0ms   cubic-bezier (0.4 , 0 , 1 , 1 );
447468
448469  .mdc-switch--unselected  &  {
449470    width token-utils .slot (slide-toggle-unselected-icon-size , $fallbacks );
450471    height token-utils .slot (slide-toggle-unselected-icon-size , $fallbacks );
451472    fill token-utils .slot (slide-toggle-unselected-icon-color , $fallbacks );
473+     color token-utils .slot (slide-toggle-unselected-icon-color , $fallbacks );
452474  }
453475
454476  .mdc-switch--unselected.mdc-switch--disabled  &  {
455477    fill token-utils .slot (slide-toggle-disabled-unselected-icon-color , $fallbacks );
478+     color token-utils .slot (slide-toggle-disabled-unselected-icon-color , $fallbacks );
456479  }
457480
458481  .mdc-switch--selected  &  {
459482    width token-utils .slot (slide-toggle-selected-icon-size , $fallbacks );
460483    height token-utils .slot (slide-toggle-selected-icon-size , $fallbacks );
461484    fill token-utils .slot (slide-toggle-selected-icon-color , $fallbacks );
485+     color token-utils .slot (slide-toggle-selected-icon-color , $fallbacks );
462486  }
463487
464488  .mdc-switch--selected.mdc-switch--disabled  &  {
465489    fill token-utils .slot (slide-toggle-disabled-selected-icon-color , $fallbacks );
490+     color token-utils .slot (slide-toggle-disabled-selected-icon-color , $fallbacks );
466491  }
467492}
468493
469- .mdc-switch--selected  .mdc-switch__icon--on ,
470- .mdc-switch--unselected  .mdc-switch__icon--off  {
494+ .mdc-switch--selected  .mdc-switch__icons  [matCheckedIcon ],
495+ .mdc-switch--unselected  .mdc-switch__icons  [matUncheckedIcon ],
496+ .mdc-switch--disabled.mdc-switch--selected  .mdc-switch__icons  [matCheckedDisabledIcon ],
497+ .mdc-switch--disabled.mdc-switch--unselected  .mdc-switch__icons  [matUncheckedDisabledIcon ] {
471498  opacity 1 ;
472499  transition opacity  45ms   30ms   cubic-bezier (0 , 0 , 0.2 , 1 );
473500}
0 commit comments