File tree Expand file tree Collapse file tree 4 files changed +25
-7
lines changed Expand file tree Collapse file tree 4 files changed +25
-7
lines changed Original file line number Diff line number Diff line change @@ -113,12 +113,10 @@ select {
113113 }
114114}
115115
116- input :not ([type = ' radio' ], [type = ' checkbox' ]),
117- textarea ,
118- select {
116+ a {
119117 & :focus ,
120118 & :focus-visible {
121- outline-offset : 0 ;
119+ outline-offset : 2 px ;
122120 }
123121}
124122
Original file line number Diff line number Diff line change 117117 border-color : var (--color-btn-primary-hover-border );
118118 }
119119
120+ // fallback :focus state
121+ & :focus {
122+ @include focusOutline (var (--color-fg-on-emphasis ), -4px );
123+
124+ // remove fallback :focus if :focus-visible is supported
125+ & :not (:focus-visible ) {
126+ outline : solid 1px transparent ;
127+ }
128+ }
129+
130+ // default focus state
131+ & :focus-visible {
132+ @include focusOutline (var (--color-fg-on-emphasis ), -4px );
133+ }
134+
120135 & :active ,
121136 & .selected ,
122137 & [aria-selected = ' true' ] {
Original file line number Diff line number Diff line change 2020 text-decoration : underline ;
2121 }
2222
23+ & :focus ,
24+ & :focus-visible {
25+ outline-offset : 2px ;
26+ }
27+
2328 & :disabled ,
2429 & [aria-disabled = ' true' ] {
2530 & ,
Original file line number Diff line number Diff line change 2727
2828// global focus styles
2929
30- @mixin focusOutline {
31- outline : 2px solid var ( --color-accent-fg ) ;
32- outline-offset : 2 px ;
30+ @mixin focusOutline ( $outlineColor : var ( --color-accent-fg ), $outlineOffset : -2 px ) {
31+ outline : 2px solid $outlineColor ;
32+ outline-offset : $outlineOffset ;
3333}
You can’t perform that action at this time.
0 commit comments