Skip to content
easeweb
Search topics

Focus rings too thin or faint to spot

A 1-pixel, pale blue outline technically shows focus, but it is too small and too close to the page colour to find at a glance.

WCAG 2.2
SC 2.4.13AAA· new in 2.2
Required by
Not required by Section 508 or EN 301 549
Broken outline: 1px solid #a8c7fa
The accessibility problem illustrated: Low vision:Is Save selected?
01

The problem

People with low vision can't find a focus ring that is a pale hairline

02

Try it

Press Tab and try to spot the focused button

Press Tab to move through the buttons on the white page and the navy banner.

Broken Can you fix this?

BrokenA hairline ring

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Draw focus at least 2px thick, with 3:1 contrast

Before
BrokenA hairline ring
.brand-button:focus-visible {  outline: 1px solid #a8c7fa;  outline-offset: 2px;}
What is wrong2 points
  • Focus is barely visible. The ring is 1 pixel thick, half the 2 pixels required.
  • On a white page the ring fades into the background. Its pale blue is only 1.72:1 against the white it replaces, where 3:1 is needed.
After

A solid 2px ring for each surface

.brand-button:focus-visible {  outline: 2px solid #1a5fb4;  outline-offset: 2px;}/* On the navy banner, the blue would be 2.45:1, so switch to white. */.banner .brand-button:focus-visible {  outline-color: #fff;}
How it is fixed3 steps
  1. Make the ring 2 pixels thick, outside the button. Its perimeter is larger than the button's, so its area is more than enough.
  2. Colour it #1a5fb4, which replaces white on the page at 6.29:1.
  3. On the navy banner, where the blue would be 2.45:1, switch the ring to white, which replaces #0b2545 at 15.39:1.

This fixes the Before and passes 2.4.13, but only on the surfaces you have set a colour for: each new background needs its own check and, often, its own rule.

04

Design ideas

There is more than one way to show focus clearly

Four more ways to show which of the guide’s buttons has focus. Press Tab to move through them: two you can spot at a glance, and two you have to hunt for.

In the design file

  • Draw the focus state on each background the button sits on, the white page and the dark blue banner, separate from hover and pressed.
  • Draw the focus ring 2 pixels thick and 2 pixels outside the button, or 3 pixels thick if it sits inside.
  • Write the ring’s contrast ratio against the colour behind it, at least 3:1. The example has 6.29:1 for blue on white and 15.39:1 for white on dark blue.
  • If focus is shown by a shadow or a fill, also draw an outline, because a Windows contrast theme removes shadows and fills.

Passes

  • White line inside the pill A 3px white line just inside the blue edge, 6.29:1 against the blue it replaces. A line drawn inside needs that third pixel to match a 2px ring outside, and in return it takes no room in the layout and no tight container can clip it.
  • Thick bar under the word A 6px #1a5fb4 bar along the bottom of the focused word, 6.29:1 against white. An 80 by 32 pixel button needs 448 square pixels of change, so the 3px bar many tab bars use covers only about half; at 6px the bar gives 480.

Fails

  • Soft glowWCAG 2.4.13 A 4px halo of #c6d7ec, the button’s blue at a quarter strength: 1.47:1 against white, under the 3:1 needed. A contrast theme removes shadows, so there it shows nothing at all.
  • Word that only turns blueWCAG 2.4.13 Focus turns the word from #1a1a1a to #1a5fb4, just as hover does. Only the letters change, at 2.77:1, and they cover far less than a 2px ring would.
05

Verify the fix

5 checks, no mouse.

Test with: Contrast measurement, Keyboard, Zoom, Forced colors

0 of 5 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the shared theme or component styles change.

Limits

2.4.13 is a AAA criterion, so most conformance targets don't require it. It is still the clearest test of whether focus is easy to see, and a ring that passes it also passes 2.4.7; 1.4.11, which measures the ring against the colours beside it, is a separate check, covered in low-contrast focus rings against the background. The colours here are examples; measure your own. Test the complete journey on your real surfaces.

This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.

EaseWeb service

Fixed it? Keep it from coming back.

I turn guides like this one into rules your coding agents follow and checks your CI runs. Then I retest by hand with a keyboard and screen readers, periodically.

See the service