Contrast Checker for Focus Indicators
Keyboard users rely on the focus outline to know which link or field is active. If the outline blends into the page, the site becomes almost impossible to use without a mouse. Check your focus color here. A single color pair decides whether it works.
What the focus outline must contrast with
Under WCAG 2.1 success criterion 1.4.11, the visual focus indicator is part of the component's state and needs at least 3:1 against the colors next to it. In practice, that means checking the outline color against the page background. If the outline sits directly on the edge of a button, check it against the button fill as well. A light blue glow on a white page, a common browser customization, can drop well below 3:1.
WCAG 2.2 adds success criterion 2.4.13 (AAA), which also asks for a change of contrast between the focused and unfocused states and a minimum indicator size.
Designs that work everywhere
The hardest case is a site with both light and dark sections, where one focus color passes on one and fails on the other. A two-color ring solves this: for example, a dark inner outline with a white outer outline, so at least one of them contrasts with any background. A thick outline of 2px or more with a small offset from the element is easier to spot than a thin 1px line or a subtle shadow.
Questions
What contrast does a focus indicator need?
At least 3:1 against the adjacent colors under success criterion 1.4.11. That usually means the page background, and possibly the component it surrounds. WCAG 2.4.7 also requires a visible focus indicator in the first place, so removing it entirely is a failure regardless of contrast.
Can I use the browser default focus ring?
Modern browsers draw a reasonably visible default ring, often two-toned, and keeping it is far better than removing it. Custom brand-colored rings are fine too, but test them, since a light brand color can disappear against white or pastel sections of your site.
Is a color change on focus enough?
Only if the change itself is easy to perceive. Switching a button from one blue to a slightly different blue is rarely noticeable. An outline or underline that appears on focus, with 3:1 contrast against the background, is much clearer for keyboard users.
Get a beautiful, accessible interface designed by VYZEON.
See UI/UX design