File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 10
10
/// @type Color
11
11
$switch-background : $medium-gray !default ;
12
12
13
+ /// Background color of a switch on focus.
14
+ /// @type Color
15
+ $switch-background-focus : scale-color ($switch-background , $lightness : -10% ) !default ;
16
+
13
17
/// Background active color of a switch.
14
18
/// @type Color
15
19
$switch-background-active : $primary-color !default ;
16
20
21
+ /// Background active color of a switch on focus.
22
+ /// @type Color
23
+ $switch-background-active-focus : scale-color ($switch-background-active , $lightness : -15% ) !default ;
24
+
17
25
/// Height of a switch, with no class applied.
18
26
/// @type Number
19
27
$switch-height : 2rem !default ;
@@ -140,6 +148,21 @@ $switch-cursor-disabled: not-allowed !default;
140
148
}
141
149
}
142
150
151
+
152
+ // Change the visual style when the switch is focused
153
+ input :focus-visible ~ & {
154
+ background : $switch-background-focus ;
155
+
156
+ & ::after {
157
+ background : $switch-paddle-background ;
158
+ }
159
+ }
160
+
161
+ input :checked:focus-visible ~ & {
162
+ background : $switch-background-active-focus ;
163
+ }
164
+
165
+
143
166
// indicate a disabled switch
144
167
input :disabled ~ & {
145
168
cursor : $switch-cursor-disabled ;
You can’t perform that action at this time.
0 commit comments