How to fix focus not visible on Headless / Custom (I build in code)

Add a clearly visible focus indicator to every interactive element so keyboard users can always see which element is currently selected.

Steps for Headless / Custom (I build in code)

  1. Search your entire CSS/SCSS/styled-components codebase for `outline: none` or `outline: 0` using your IDE's global search.
  2. Remove or scope those rules to only apply where absolutely necessary (e.g. when you are providing a fully custom focus style for that element).
  3. Add the universal :focus / :focus-visible rule in your global stylesheet so it applies site-wide.
  4. Ensure your design system's component library (button, input, link, modal trigger) all expose a visible focus state.
  5. Run axe DevTools or Lighthouse in CI to enforce no regression.
Official Headless / Custom (I build in code) documentation ↗

What is focus not visible?

When someone navigates your store using only a keyboard (Tab, Shift+Tab, arrow keys), their browser highlights the currently focused element — a button, link, form field, etc. — so they know where they are. This is called the "focus indicator" or "focus ring." The problem occurs when a theme or custom CSS removes or hides this highlight (often via `outline: none` or `outline: 0`), making the page look cleaner but leaving keyboard users completely lost. WCAG Success Criterion 2.4.7 (Focus Visible) requires that this focus indicator always be visible.

Roughly 7% of internet users navigate primarily by keyboard — including people with motor disabilities, power users, and anyone whose mouse has stopped working. If they can't see where focus is, they literally cannot use your store: they can't tell which product they're about to add to the cart, which field they're typing in, or which button they're about to press. Beyond lost sales, hiding focus indicators is a WCAG 2.1 Level AA violation, which creates legal exposure under the ADA, the European Accessibility Act, and similar laws in many countries. Accessible stores also tend to rank better because Google uses accessibility signals as a quality indicator.

See the complete Focus not visible guide for every platform and the full background.

Not sure if your Headless / Custom (I build in code) store has this?

Run a free SEOLZ scan — we’ll find focus not visible and every other issue across your whole site.

Scan my site free

Fix focus not visible on another platform