published fresh until

Why can't I see the keyboard focus ring in my AI-built UI?

Summary As of October 2026, agents often strip the browser focus outline with outline: none or focus:outline-none. As of November 2026, Tailwind v4.3.5 says outline-none now truly removes it and outline-hidden keeps an invisible outline that still shows in forced-colors mode; replace the removed ring with focus-visible styles so keyboard users can see where they are.

Not for running a full accessibility audit or test in CI, see agent-built-ui-fails-accessibility-add-axe-playwright-check

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

The default blue focus ring looks ugly, so the agent adds outline: none or focus:outline-none and moves on; keyboard users then cannot see where they are (a failure of WCAG focus visibility). Related reports: focus:outline-none not working Tailwind CSS on Stack Overflow and the Tailwind issue outline-none doesn't work on button with focus in chrome.

What Tailwind's v4 upgrade guide says

The old outline-none set an invisible outline that still shows in forced colors mode, for accessibility. In v4 it was renamed outline-hidden, and a new outline-none really sets outline-style: none. The guide's migration is to replace focus:outline-none with focus:outline-hidden. Ring defaults also changed: ring is now 1px and currentColor, so rings you relied on may look different.

What to tell the agent

  • Never remove the outline without a replacement. Use :focus-visible (Tailwind focus-visible:), which shows for keyboard focus and mostly not for mouse clicks.
  • Example: focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-600, or focus-visible:ring-2 ring-offset-2 if you use rings. Keep contrast against the background.
  • In v4 prefer outline-hidden over outline-none when you also add your own ring.
  • After the change, press Tab through the page and check that every control shows a ring; a mouse click on a button generally will not.

A prompt worth trying (mine, untried): "Search for outline-none, outline: none and focus:outline-none. For each, add a visible focus-visible style with at least a 3:1 contrast against its background. Then tab through the page and list any control with no visible focus."

Common mistakes

Using :focus instead of :focus-visible (styling every focused element regardless of input method), a ring that matches the background, and overflow: hidden on a parent clipping the ring.

Limits

I did not run these prompts or reproduce the bugs; the CSS behaviour is from the cited docs.

Primary source

  • Primary source: Upgrade guide - Tailwind CSS (v4) (Tailwind CSS)
  • v3 outline-none set an invisible outline that still shows in forced colors mode; v4 renames that to outline-hidden, and the new outline-none sets outline-style: none. Default ring changed from 3px blue-500 to 1px currentColor. (doc)

Sources

Checked against primary sources:

Not checked here: the Stack Overflow question (Stack Overflow not opened), the 3:1 contrast figure in the sample prompt (our advice, not read from WCAG 1.4.11 here), and the example class lists. Nothing was run.

Started from a post by @Stack Overflow question by Thomas Read; Tailwind CSS v4 upgrade guide, packaged by the editor. Original post

Subjects

More in prompting

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Why can't I see the keyboard focus ring in my AI-built UI?
Summary: As of October 2026, agents often strip the browser focus outline with outline: none or focus:outline-none. As of November 2026, Tailwind v4.3.5 says outline-none now truly removes it and outline-hidden keeps an invisible outline that still shows in forced-colors mode; replace the removed ring with focus-visible styles so keyboard users can see where they are.
Copy for agent
get the whatworks thread keyboard-focus-ring-invisible-outline-none-focus-visible and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread keyboard-focus-ring-invisible-outline-none-focus-visible
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp