All articles
Design & UXNovember 10, 2026 6 min read

Focus Rings in 2026: Stop Hiding Them, Start Designing Them

Focus rings are the most-deleted accessibility feature in modern design systems. Here's how to design ones that keep keyboard users safe without making your brand team cry.

The first thing most designers do when they inherit a design system is remove the browser's default focus ring. The second thing they do is forget to replace it. We've audited enough production apps to call this what it is: the single most common accessibility regression in modern UIs, and it's almost always a design decision, not an engineering one.

Let's fix it properly — with tokens, with :focus-visible, and with a system that survives brand refreshes.

Why focus rings keep getting deleted

The honest answer: they look bad. A default Chromium ring on a rounded indigo button looks like a bug. A Safari ring on a dark background disappears. A focus ring on a card component clips at the corners. Designers see these in Figma mockups that have no interactive state, decide the UI feels "cleaner" without them, and ship a CSS reset that nukes outline.

Then a keyboard user — someone with a motor disability, a power user on Vim bindings, or anyone tabbing through a form — loads the page and has no idea where they are.

The WCAG 2.2 success criterion 2.4.11 Focus Not Obscured and 2.4.13 Focus Appearance both tightened the rules on this. If you're shipping to the EU after the European Accessibility Act kicked in, or to any US government-adjacent client, invisible focus is now a legal problem, not just a taste problem.

The three failure modes

In our audits, missing-or-broken focus falls into three buckets:

  1. Nuked entirely — someone wrote *:focus { outline: none } in 2019 and never came back.
  2. Styled but invisible — a 1px ring in a color with 2:1 contrast against the background.
  3. Styled but clipped — overflow: hidden on a parent cuts the ring off, usually on cards and dropdowns.

All three are fixable in an afternoon if you treat focus as a first-class design token.

Design the ring once, apply it everywhere

The biggest mistake is treating focus as a per-component concern. It's not. It's a system primitive, like your border radius scale or your shadow ramp. Define it once at the token layer.

Here's the token shape we use on most projects:

{
  "focus": {
    "ring": {
      "width": "2px",
      "offset": "2px",
      "color": "{color.accent.500}",
      "colorOnAccent": "{color.neutral.0}",
      "style": "solid"
    }
  }
}

Two colors, not one. The ring on a white background uses your accent color. The ring on top of that same accent color (a focused primary button, for example) flips to a neutral — usually white or near-white. This is the single change that makes focus rings stop looking broken on colored surfaces.

Contrast requirements that actually matter

WCAG 2.2 requires the focus indicator to have at least 3:1 contrast against the adjacent unfocused state. That means:

  • Ring against the page background: 3:1 minimum.
  • Ring against the component it's wrapping: 3:1 minimum.
  • If you're using an offset (you should be), the offset gap counts as background.

Run your two focus colors through a contrast checker against your top five surface colors. If any pair fails, you need a third focus color or a thicker ring. We usually pick the third option — a 3px ring buys you a lot of headroom.

The :focus-visible pattern that works

The modern recipe is short. Reset the default, then restore it only when the user is navigating with a keyboard. :focus-visible handles the heuristic for you — mouse clicks don't trigger it, keyboard tabs do.

:root {
  --focus-ring-width: 2px;
  --focus-ring-offset: 2px;
  --focus-ring-color: oklch(0.65 0.2 250);
  --focus-ring-color-inverse: oklch(0.98 0 0);
}

*:focus {
  outline: none;
}

*:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
  border-radius: inherit;
}

.btn-primary:focus-visible {
  outline-color: var(--focus-ring-color-inverse);
}

A few things worth noting:

  • outline (not box-shadow) is correct here. Outlines don't affect layout and they respect the element's shape in modern browsers.
  • outline-offset creates a visible gap between the element and the ring. This is what makes focus feel intentional instead of accidental.
  • border-radius: inherit on the focus style is a cheap trick to make rounded corners follow through.

When you need box-shadow instead

Outlines still render as rectangles on some older WebKit builds when combined with certain transforms. If you're supporting those, or you need a glow effect, fall back to a double box-shadow:

.input:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--surface-background),
    0 0 0 4px var(--focus-ring-color);
}

The first shadow fakes the offset gap in the surface color. The second is the actual ring. This also solves the overflow: hidden clipping problem because box shadows render outside the clip region on most parents.

Tailwind: the ring utilities are almost right

If you're using Tailwind, the ring-* utilities get you 80% of the way. The gaps:

  • The default ring is 3px, which is fine, but it uses box-shadow — so it stacks with other shadows and can look muddy.
  • ring-offset-* requires you to set ring-offset-color or it defaults to white, which breaks on dark surfaces.
  • focus:ring applies on all focus states; you almost always want focus-visible:ring instead.

A sensible component pattern:

<button class="
  bg-indigo-600 text-white rounded-lg px-4 py-2
  focus:outline-none
  focus-visible:ring-2
  focus-visible:ring-white
  focus-visible:ring-offset-2
  focus-visible:ring-offset-indigo-600
">
  Save changes
</button>

Notice the ring-offset-color matches the button background. That's the detail that keeps the gap from looking like a rendering glitch.

For a design-system-wide fix, extend your Tailwind config with semantic focus tokens so individual components don't have to remember the pattern:

// tailwind.config.js
theme: {
  extend: {
    ringColor: {
      DEFAULT: 'var(--focus-ring-color)',
      inverse: 'var(--focus-ring-color-inverse)'
    },
    ringOffsetColor: {
      DEFAULT: 'var(--surface-background)'
    }
  }
}

Handling the hard components

Buttons and inputs are easy. The components that trip teams up:

Cards that are entire click targets. Don't put focus on the card — put it on the heading link inside, and use :has(:focus-visible) on the card to show a subtle secondary indicator. This keeps the semantic structure clean.

Custom checkboxes and radios. The hidden-input-plus-styled-label pattern means focus lands on the invisible input. Apply focus styles to the sibling label with input:focus-visible + label.

Segmented controls and tabs. Only the active tab should be in the tab order. Use roving tabindex, and the focus ring goes on the actively-focused tab, not all of them.

Dropdowns and comboboxes. Focus stays on the trigger while the menu is open. The menu items get a highlighted state, not a focus ring — that's an ARIA aria-activedescendant pattern, not a true focus move.

The clipping problem, solved

If you absolutely must have overflow: hidden on a parent (image cards, for example), either:

  • Move the focus ring to a wrapper element outside the clip, or
  • Use box-shadow on the inner element with a negative spread to pull it inward slightly.

The wrapper approach is cleaner. A single <div class="focus-within:ring-2"> around a clipped card gets you the ring back without changing the clip behavior.

Testing without a screen reader

You don't need assistive tech to catch 90% of focus bugs. Three habits:

  1. Tab through every new page before you merge. If you lose the cursor, the ring failed.
  2. Screenshot focused states in your component library (Storybook's play function handles this).
  3. Run axe-core or Pa11y in CI — both flag missing focus indicators as a serious violation.

In our experience, teams that add a tab-through to their PR template catch roughly 70–80% of focus regressions before they ship. It takes thirty seconds per page.

Where we'd start

If your design system has no focus tokens today, don't try to redesign every component at once. Do this in order:

  1. Add two tokens: focus-ring-color and focus-ring-color-inverse. Pick colors that hit 3:1 against your top five backgrounds.
  2. Write one global :focus-visible rule in your reset. Ship it.
  3. Override it on your primary button and anywhere else the default fails contrast.
  4. Add a tab-through step to your QA checklist.
  5. Only then start fixing the hard components (cards, custom inputs, tabs).

Focus rings aren't a decoration — they're the UI equivalent of a cursor for a huge chunk of your users. Treat them like a system primitive, and you'll never have to argue about them in a design review again. If you want help auditing an existing system, our team covers this as part of our design and engineering work.

#Accessibility#Design Systems#CSS#UX Patterns

Want a team like ours?

72Technologies builds production software for the kind of teams who actually read this blog.

Start a project