File tree Expand file tree Collapse file tree 4 files changed +29
-17
lines changed Expand file tree Collapse file tree 4 files changed +29
-17
lines changed Original file line number Diff line number Diff line change 13
13
aria-label =" Select a color scheme preference"
14
14
class =" color-scheme-toggle"
15
15
role =" radiogroup"
16
- tabindex =" 0"
17
16
>
18
17
<label
19
18
v-for =" option in options"
@@ -85,6 +84,12 @@ input {
85
84
appearance : none ;
86
85
}
87
86
87
+ label {
88
+ @include on-keyboard-focus-within () {
89
+ @include focus-outline ();
90
+ }
91
+ }
92
+
88
93
.text {
89
94
border : 1px solid transparent ;
90
95
border-radius : var (--toggle-border-radius-inner , 2px );
Original file line number Diff line number Diff line change @@ -487,11 +487,9 @@ $input-height: rem(28px);
487
487
border-bottom-left-radius : $small-border-radius - 1 ;
488
488
border-bottom-right-radius : $small-border-radius - 1 ;
489
489
490
- .fromkeyboard & {
491
- & :focus {
492
- outline : none ;
493
- box-shadow : 0 0 0 5px var (--color-focus-color );
494
- }
490
+ @include on-keyboard-focus () {
491
+ outline : none ;
492
+ box-shadow : 0 0 0 5px var (--color-focus-color );
495
493
}
496
494
}
497
495
Original file line number Diff line number Diff line change @@ -250,15 +250,13 @@ $nesting-spacing: $card-horizontal-spacing + $card-horizontal-spacing-small;
250
250
display : flex ;
251
251
align-items : center ;
252
252
253
- .fromkeyboard & {
254
- & :focus-within {
255
- margin : $card-horizontal-spacing-small ;
256
- height : $item-height - 10px ;
257
- @include focus-outline ();
258
-
259
- .depth-spacer {
260
- margin-left : - $card-horizontal-spacing-small ;
261
- }
253
+ @include on-keyboard-focus-within () {
254
+ margin : $card-horizontal-spacing-small ;
255
+ height : $item-height - 10px ;
256
+ @include focus-outline ();
257
+
258
+ .depth-spacer {
259
+ margin-left : - $card-horizontal-spacing-small ;
262
260
}
263
261
}
264
262
}
Original file line number Diff line number Diff line change 67
67
line-height : $line-height ;
68
68
clip-path : unset ;
69
69
}
70
- }
70
+ };
71
71
72
72
/// /
73
73
/// Apply styling only when focused via the keyboard.
78
78
@content
79
79
}
80
80
}
81
- }
81
+ };
82
+
83
+ /// /
84
+ /// Apply styling only when focused via the keyboard in an element inside.
85
+ /// /
86
+ @mixin on-keyboard-focus-within () {
87
+ .fromkeyboard & {
88
+ & :focus-within {
89
+ @content
90
+ }
91
+ }
92
+ };
82
93
83
94
/// /
84
95
/// Replaces the outline effect when an element is in focus, with a box shadow effect.
You can’t perform that action at this time.
0 commit comments