Skip to content

Commit e9582a6

Browse files
committed
fix(material/slide-toggle): m3 disabled handle color and opacity
1 parent 7faffc7 commit e9582a6

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

src/material/core/tokens/m2/mat/_switch.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ $prefix: (mat, switch);
88
// but may be in a future version of the theming API.
99
@function get-unthemable-tokens() {
1010
@return (
11+
disabled-selected-handle-opacity: 0.38,
12+
disabled-unselected-handle-opacity: 0.38,
13+
1114
unselected-handle-size: 20px,
1215
selected-handle-size: 20px,
1316
pressed-handle-size: 20px,

src/material/core/tokens/m2/mdc/_switch.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ $prefix: (mdc, switch);
1818
@function get-unthemable-tokens() {
1919
@return (
2020
// Opacity of handle when disabled.
21-
disabled-handle-opacity: 0.38,
21+
disabled-handle-opacity: null,
2222
// Opacity of icon when disabled and selected.
2323
disabled-selected-icon-opacity: 0.38,
2424
// Opacity of track when disabled.

src/material/slide-toggle/slide-toggle.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,3 +224,13 @@
224224
@include token-utils.create-token-slot(border, disabled-unselected-track-outline);
225225
}
226226
}
227+
228+
@include token-utils.use-tokens(m2-mat-switch.$prefix, m2-mat-switch.get-token-slots()) {
229+
.mdc-switch--disabled.mdc-switch--selected .mdc-switch__handle::after {
230+
@include token-utils.create-token-slot(opacity, disabled-selected-handle-opacity);
231+
}
232+
233+
.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__handle::after {
234+
@include token-utils.create-token-slot(opacity, disabled-unselected-handle-opacity);
235+
}
236+
}

0 commit comments

Comments
 (0)