keyboard
Rules: 5
keyboard/focus-outline
Focused elements show no visible focus indicator
keyboard/focus-outline/missing · warning · score 6.0 · page
Keyboard users cannot tell which control is active when focusing it changes nothing on screen. Only sampled pages, walked with the Tab key in a browser, are judged.
Fix
Give :focus-visible an outline or box-shadow; never remove the outline without a replacement.
Off by default; a group that runs keyboard turns it on.
References
For rule authors
Reads
keyboard.stops
keyboard/focus
A focused element is hidden under sticky or fixed content
keyboard/focus/inaccessible · warning · score 5.8 · page
Keyboard users tab to a control they cannot see because a header or banner covers it. Only sampled pages, walked with the Tab key in a browser, are judged.
Fix
Set scroll-padding-top to the sticky header’s height, or keep banners from covering the content.
Off by default; a group that runs keyboard turns it on.
References
For rule authors
Reads
keyboard.stops
keyboard/forced-colors-focus
Focus indicators vanish under forced colours
keyboard/forced-colors-focus/missing · warning · score 5.4 · page
A focus ring drawn only with box-shadow disappears in Windows high-contrast mode, so keyboard users lose track of focus. Only sampled pages are judged, in a browser.
Fix
Add outline: 2px solid transparent beside a box-shadow focus ring; forced colours drop the shadow and paint the outline.
Off by default; a group that runs keyboard turns it on.
References
For rule authors
Reads
keyboard.stops
keyboard/skip-link
The first Tab stop is not a skip link to the main content
keyboard/skip-link/missing · info · score 2.8 · page
Keyboard and screen-reader users must tab through the whole navigation on every page before reaching the content. Only sampled pages are judged, in a browser.
Fix
Make the first focusable element <a href="#main">Skip to content</a>, pointing at <main id="main">.
Off by default; a group that runs keyboard turns it on.
References
For rule authors
Reads
keyboard.first
keyboard/tab-order
Keyboard focus is trapped or skips interactive elements
keyboard/tab-order/inaccessible · warning · score 6.4 · page
Visitors who cannot use a mouse get stuck or cannot reach a control at all. Only sampled pages, walked with the Tab key in a browser, are judged.
Fix
Let Tab reach every control: drop negative tabindex from interactive elements, and release focus from any widget that holds it.
Off by default; a group that runs keyboard turns it on.
References
For rule authors
Reads
keyboard.trapkeyboard.unreached