Skip to content
ChromaBrew
Go Pro
TutorialsBy Opeyemi Olorunfemi

Focus rings and glows people can actually see

A worked tutorial: build 3:1 focus indicators with box-shadow rings, add tasteful glows, and test the tab order like a keyboard user.

Build the ring from two layers

The robust focus ring is two box-shadows: a 2px inner ring in the page background color (to cut through any backdrop) plus a 2–4px outer ring in the action hue. This double ring stays visible on white, on images, on brand fills — everywhere a single outline color eventually fails.

Size it generously: 2px minimum thickness with a 2px offset from the element. Hairline rings disappear at normal viewing distances, and rings hugging the edge merge with borders. Visibility is the entire job; subtlety is the enemy.

:focus-visible {\n  outline: none;\n  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2563eb;\n}

Check 3:1 against every neighbor

Focus indicators must hit 3:1 against adjacent colors — the UI-component threshold, not the text one. Check the ring color against the element fill, the page ground, and (for the double ring) both layers against each other. Brand-hue rings usually pass on white and fail on brand fills, which is exactly where the white separator layer earns its place.

Never remove focus styles to 'clean up' the design, and never show rings on mouse click (use :focus-visible, which shows them for keyboard input). Both failure modes are common, and both abandon keyboard users.

Glows are decoration — treat them so

Glow shadows (large-blur, colored, low-opacity) make CTAs and active states feel alive, but they are decoration layered over a passing base state — the button must work with glows disabled. Keep glow opacity low enough that text on the glowing element still passes, since the glow lightens the fill beneath the label.

Test the tab order end-to-end after styling: ring on every interactive element, in a sensible sequence, with no traps. A beautiful ring on a broken order is paint on a locked door.

Tip

Dim the screen and tab through with only the keyboard. Every stop should announce itself visually before you read a word — if you hunt for the ring, it failed.

Related free tools

Want to apply this right now? Open the color palette generator and try it with your own brand color — free, no sign-up.