INTRODUCTION
Somewhere in most codebases there is a line that says outline: none. It was added years ago because a blue rectangle appeared around a button when someone clicked it, and it looked like a bug. The rectangle went away. So did the only signal telling keyboard users where they are on the page.
The focus indicator is not a browser leftover. It is a state of every interactive component, like hover and pressed, and it deserves the same attention. The good news is that the old reason for deleting it no longer exists.
Why the ring was removed, and why that reason is gone
MDN tells the history plainly in its reference page for the selector :focus-visible. Browsers used to draw a focus ring on anything that received focus, including links and buttons clicked with a mouse. Many people found that ugly, so authors removed the outline, and keyboard navigation became unusable for sighted people.
Browsers have since changed their behaviour. They now use heuristics to show focus only when it helps: generally not when a button is clicked with a pointing device, but yes when someone moves through the page with the keyboard, and yes in a text field waiting for input. The :focus-visible selector gives you the same logic for your own styles, and MDN lists it as available across browsers since March 2022.
So the complaint that started all this, “the ring shows up when I click”, is solved at the platform level. What remains is a design question: what should the indicator look like?
What the standard asks for
Three WCAG 2.2 criteria touch the focus indicator, at different levels.
Focus Visible (2.4.7, Level AA). Any interface that can be operated by keyboard must have a mode where the keyboard focus indicator is visible. This is the floor: there has to be one.
Non-text Contrast (1.4.11, Level AA). Visual information needed to identify components and their states needs a contrast ratio of at least 3:1 against adjacent colours. A custom focus style is a state, so a pale ring on a white page does not pass.
Focus Appearance (2.4.13, Level AAA). The indicator should cover an area at least as large as a 2 CSS pixel thick perimeter of the component, and the pixels that change should differ by at least 3:1 between the focused and unfocused states.
The third one is AAA, so most teams are not contractually bound by it. It is still the most useful of the three, because it is the only one that gives a designer numbers: two pixels all the way round, and a real change in contrast. W3C's summary of why is short: many people cannot see small changes in visual appearance.
The exemption for doing nothing
Both contrast rules carry the same exception. Non-text Contrast does not apply where the appearance of the component is determined by the browser and not modified by the author. Focus Appearance excepts indicators that the author has not modified.
That is the serious counterargument to designing a focus ring at all: the default is exempt, it follows the platform people already know, and it costs you nothing. A team with no capacity for a custom indicator should leave the browser's alone, completely.
The catch is the word “completely”. The exemption ends the moment you touch the indicator. Most products already have: a reset stylesheet, a component library, or that old outline: none. And a default ring was not drawn with your brand colours in mind; a blue ring on a blue button is the browser doing its best with a background it did not choose. Once you have modified it, you own it.
A ring that works on any background
The hard part of a custom indicator is that components sit on different surfaces: white cards, a dark footer, a coloured banner, a photo. A single colour will fail on one of them.
The GOV.UK Design System solves this with two colours. Its focus state guidance describes a combination of yellow and black: the yellow has high contrast against dark backgrounds, the thick black border against light ones, so the pair meets the non-text contrast criterion on any background the service uses. You do not need their yellow. You need the principle: two contrasting layers, so that at least one always shows.
Three implementation choices keep a ring honest:
Use
outline, not only a shadow. In forced colours mode, which people turn on for contrast, MDN notes thatbox-shadowis forced to none while outline colours are replaced with system colours. A ring built only from a shadow vanishes for exactly the people who asked for more contrast.Make it one token. Width, offset and colours defined once and applied to every interactive component through
:focus-visible. A ring that differs per component is a ring that someone forgot on the next component.Leave room for it. An indicator that is clipped by a container, or covered by a sticky bar, is not visible. That second problem has its own criterion, which we covered in a sticky header should never sit on top of the focus.
A worked example
A hypothetical product has a near-black primary button that appears on white pages and in a dark footer. The team's first custom ring is a 2-pixel dark outline with a small offset. On white it is clear. In the footer it disappears into the background, and nobody notices because nobody tests the footer with a keyboard.
The second attempt uses two layers: a 2-pixel white ring directly around the button, then a 2-pixel dark outline around that. On the white page the dark line carries the contrast. In the footer the white one does. The same token goes on links, inputs and menu items, and the old outline: none is deleted instead of overridden.
Unplug the mouse
Pick your five most-used screens and move through them with the Tab key only. Note every place where you lose track of where you are: a ring that vanishes on a dark surface, a custom dropdown with no indicator, a card where the whole block is clickable but nothing shows it. Then choose one of two clean positions. Either remove every focus override and let the browser do its job, or define one indicator, two layers thick, and apply it everywhere. The position to leave is the one in between, where the default has been removed and nothing was put in its place.
If you are reviewing links at the same time, a link should say where it goes is the companion piece: the ring shows where you are, the text says where you will land.
Sources checked on 29 November 2026. WCAG Understanding documents and the GOV.UK guidance are living pages; criteria are quoted from WCAG 2.2.