Skip to content
easeweb
Search topics

Low-contrast focus rings against the background

The focus ring is drawn in a colour too close to what sits next to it: the text colour at half strength on white, or the brand blue on a blue band.

WCAG 2.2
SC 1.4.11AA· new in 2.1
Required by
EN 301 549 (EU)
Broken outline: 2px solid #1a4fd0
The accessibility problem illustrated: Low vision:Which button am I on?
01

The problem

People with low vision can't find which link or button keyboard focus is on

02

Try it

Press Tab through the header links and the buttons on the blue band

  • Broken 1: the ring is the text colour at half strength. On the band it shows; around the white header’s links it is a pale grey line.

  • Broken 2: the ring is the brand blue. Clear in the header; around the band’s buttons it sits on the band’s own blue.

  • Apply a fix. Tab through both surfaces again: the ring stands out on each.

Broken Can you fix this?

Free delivery this week

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Give the focus ring 3:1 against every surface it sits on

Before

A ring in the text colour at half strength

:root {  --ink: 67 67 67;}.sale-band {  --ink: 255 255 255;  background: #12348f;}.site-header,.sale-band {  color: rgb(var(--ink));}.sale-band .button {  background: #fff;  color: #12348f;}:focus-visible {  /* The text colour at half strength */  outline: 2px solid rgb(var(--ink) / 0.5);  outline-offset: 2px;}
What is wrong3 points
  • The ring takes its colour from the text, at half opacity, so its contrast depends on how dark the text is.
  • In the white header it blends to #a1a1a1, at 2.58:1 against the white around it.
  • On the band it blends to #899ac7, at 3.92:1, so the fault shows only on white.
After

A ring per surface

:root {  --ink: 67 67 67;  --focus-ring: #1a4fd0;}.sale-band {  --ink: 255 255 255;  --focus-ring: #fff;  background: #12348f;}.site-header,.sale-band {  color: rgb(var(--ink));}.sale-band .button {  background: #fff;  color: #12348f;}:focus-visible {  outline: 2px solid var(--focus-ring);  outline-offset: 2px;}
How it is fixed3 steps
  1. Add a --focus-ring token, solid and not translucent, set to the brand blue on the page: 6.83:1 against white.
  2. Set the token again on the band, to white: 10.97:1 against #12348f.
  3. Draw the ring from the token, so each surface gets the colour checked for it.

This fixes both Befores and passes 1.4.11 on the two surfaces set here. Every new surface, such as a dark footer or a coloured card, needs its own value and its own check.

04

Verify the fix

4 checks, no mouse.

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

0 of 4 checked

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

Limits

This is a starting pattern, not a guarantee for every application. The colours and token names are examples; measure your own ring on your real surfaces. A ring that reaches 3:1 can still be hard to find if it is thin, and 2.4.13 asks for more, as the focus appearance guide explains. Test the complete journey with people who rely on the ring.

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