Focus visible: the outline you should never remove

Published 29 October 2026

In short: WCAG 2.4.7 Focus Visible (level AA) requires that any keyboard-operable page has a mode where you can see which element has keyboard focus. The W3C's reason is one sentence: "Without a focus indicator, sighted keyboard users cannot operate the page." Deleting the default outline for aesthetics and adding nothing in its place is a documented failure - restyle it all you like, but the indicator must exist, stay visible while focus is on the element, and have enough contrast to see.

Who does this affect?

Anyone who operates the page by keyboard and can see the screen: people with motor impairments using keyboards or switch devices, power users tabbing through forms, screen-reader users with partial sight. The mouse pointer always shows where it is; keyboard focus is invisible unless someone draws it. Focus order and traps are the neighboring checks in our 10-minute keyboard test - 2.4.7 is the one that makes the position visible at all.

What passes and what fails?

Pattern2.4.7 statusNote
Default browser outline, untouchedPassesTechnique G165: platform defaults carry over well, including to forced-colors modes
Custom focus style with real contrastPassesAuthor-supplied indicators are fine (G195); a two-color scheme survives more backgrounds (C40)
:focus-visible rulesPassesC45: indicator appears for keyboard users without ringing every mouse click
outline:none with no replacementFailsF78: removing or hiding the visual indicator
Script that blurs elements on focusFailsF55: removing focus programmatically when it is received
Indicator that fades after a secondFailsThe indicator must not be time-limited while focus remains

What about contrast and forced colors?

Because focus indicators are drawn with borders, outlines or shadows, they count as non-text content and must meet 1.4.11 Non-text Contrast (AA) - 3:1 against adjacent colors. A pale-gray ring on a white card fails even though an indicator technically exists. Two more practical notes: WCAG 2.2's AAA-level 2.4.13 Focus Appearance gives sizing guidance if you want to go beyond AA, and remember that box-shadow focus rings vanish entirely in forced colors mode, which is why a real outline or border is the safer base.

How do you test it in two minutes?

Put the mouse away and press Tab. At every stop, answer out loud: "where is focus right now?" If you ever cannot tell, you have found a 2.4.7 problem. Then check the ring itself: can you see it against every background it lands on, including your dark footer and your brand-colored buttons?

Frequently asked questions

Is outline:none always a WCAG failure?

Only when it removes the focus indicator without a replacement. The failure is styling outlines or borders in a way that removes or hides the visual indicator (F78). Replacing the default outline with your own clearly visible focus style is allowed - removing it and adding nothing is not.

Does the CSS :focus-visible pseudo-class help with WCAG 2.4.7?

Yes, it is a documented technique (C45). Browsers use heuristics to show a focus indicator mainly when the user is navigating by keyboard, which satisfies the "mode of operation" wording in 2.4.7 and avoids showing rings on every mouse click.

What contrast does a focus indicator need?

Focus indicators are non-text visual information, so they fall under 1.4.11 Non-text Contrast (AA), which asks for 3:1 against adjacent colors. WCAG 2.2's AAA-level 2.4.13 Focus Appearance gives further guidance on size and shape for a consistently visible indicator.

General information, not legal advice.

From the same small team: Memory Quest, a free memory-training game for Android, on Google Play.

Sources