Skip to content

Commit

Permalink
fix(a11y): hide focus outline when not tabbing
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristiaanScheermeijer committed Jun 12, 2024
1 parent 70c34c5 commit 3d1cbf1
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/ui-react/src/styles/accessibility.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ $focus-box-shadow: 0 0 1px 5px var(--highlight-color, variables.$white),
@mixin globalClassNames {
/* Clearly visible focus rectangle (WCAG guidelines). */
@media (hover: hover) and (pointer: fine) {
a,
[role='button'],
button,
input {
&:focus {
outline: 2px solid var(--highlight-color, #fff);
box-shadow: 0 0 2px 3px var(--highlight-contrast-color, #000);
body.is-tabbing {
a,
[role='button'],
button,
input {
&:focus {
outline: 2px solid var(--highlight-color, #fff);
box-shadow: 0 0 2px 3px var(--highlight-contrast-color, #000);
}
}
}
}
Expand Down

0 comments on commit 3d1cbf1

Please sign in to comment.