Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 71e0411

Browse files
Splaktarjelbourn
authored andcommitted
fix(switch): theming issues with focus in dark theme (#11459)
Closes #8518 Fixes #11417
1 parent 0306ac0 commit 71e0411

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

src/components/switch/switch-theme.scss

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,20 @@ md-switch.md-THEME_NAME-theme {
99
background-color: '{{background-500}}';
1010
}
1111

12-
&.md-checked {
12+
&.md-focused {
13+
&:not(.md-checked) {
14+
.md-thumb:before {
15+
background-color: '{{foreground-4}}';
16+
}
17+
}
18+
&[disabled] {
19+
.md-thumb:before {
20+
background-color: '{{foreground-4}}';
21+
}
22+
}
23+
}
24+
25+
&.md-checked:not([disabled]) {
1326
.md-ink-ripple {
1427
color: '{{accent-color}}';
1528
}

src/components/switch/switch.scss

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,13 @@ md-switch {
6161
}
6262
}
6363

64-
&.md-focused:not([disabled]) {
64+
&.md-focused {
6565
.md-thumb:before {
6666
left: -8px;
6767
top: -8px;
6868
right: -8px;
6969
bottom: -8px;
7070
}
71-
72-
&:not(.md-checked) {
73-
.md-thumb:before {
74-
background-color: rgba(0, 0, 0, 0.12);
75-
}
76-
}
7771
}
7872

7973
.md-label {

0 commit comments

Comments
 (0)