@@ -12,12 +12,28 @@ $md-slide-toggle-thumb-size: 20px !default;
1212$md-slide-toggle-margin : 16px !default ;
1313
1414@mixin md-switch-checked ($palette ) {
15- .md-slide-toggle-thumb {
16- background-color : md-color ($palette );
15+ & .md-checked {
16+ .md-slide-toggle-thumb {
17+ background-color : md-color ($palette );
18+ }
19+
20+ .md-slide-toggle-bar {
21+ background-color : md-color ($palette , 0.5 );
22+ }
1723 }
24+ }
25+
26+ @mixin md-switch-ripple ($palette ) {
27+ // Temporary ripple effect for the thumb of the slide-toggle.
28+ // Bind to the parent selector and specify the current palette.
29+ @include md-temporary-ink-ripple (slide- toggle, true, $palette );
1830
19- .md-slide-toggle-bar {
20- background-color : md-color ($palette , 0.5 );
31+ & .md-slide-toggle-focused {
32+ & :not (.md-checked ) .md-ink-ripple {
33+ // When the slide-toggle is not checked and it shows its focus indicator, it should use a 12% opacity
34+ // of black in light themes and 12% of white in dark themes.
35+ background-color : md-color ($md-foreground , divider );
36+ }
2137 }
2238}
2339
@@ -34,21 +50,24 @@ $md-slide-toggle-margin: 16px !default;
3450 outline : none ;
3551
3652 & .md-checked {
37- @include md-switch-checked ($md-accent );
38-
39- & .md-primary {
40- @include md-switch-checked ($md-primary );
41- }
42-
43- & .md-warn {
44- @include md-switch-checked ($md-warn );
45- }
46-
4753 .md-slide-toggle-thumb-container {
4854 transform : translate3d (100% , 0 , 0 );
4955 }
5056 }
5157
58+ @include md-switch-checked ($md-accent );
59+ @include md-switch-ripple ($md-accent );
60+
61+ & .md-primary {
62+ @include md-switch-checked ($md-primary );
63+ @include md-switch-ripple ($md-primary );
64+ }
65+
66+ & .md-warn {
67+ @include md-switch-checked ($md-warn );
68+ @include md-switch-ripple ($md-warn );
69+ }
70+
5271 & .md-disabled {
5372
5473 .md-slide-toggle-label , .md-slide-toggle-container {
0 commit comments