Skip to content

Commit a174402

Browse files
fix(a11y): hide focus outline when not tabbing
1 parent 70c34c5 commit a174402

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

packages/ui-react/src/styles/accessibility.scss

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ $focus-box-shadow: 0 0 1px 5px var(--highlight-color, variables.$white),
4141
@mixin globalClassNames {
4242
/* Clearly visible focus rectangle (WCAG guidelines). */
4343
@media (hover: hover) and (pointer: fine) {
44-
a,
45-
[role='button'],
46-
button,
47-
input {
48-
&:focus {
49-
outline: 2px solid var(--highlight-color, #fff);
50-
box-shadow: 0 0 2px 3px var(--highlight-contrast-color, #000);
44+
body.is-tabbing {
45+
a,
46+
[role='button'],
47+
button,
48+
input {
49+
&:focus {
50+
outline: 2px solid var(--highlight-color, #fff);
51+
box-shadow: 0 0 2px 3px var(--highlight-contrast-color, #000);
52+
}
5153
}
5254
}
5355
}

0 commit comments

Comments
 (0)