[Bug]: Keyboard focus indicators disappear in Windows contrast themes #47762
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/web
Steps to reproduce#
- Turn on a Windows contrast theme (Settings → Accessibility → Contrast themes), or enable
forced-colors: activeemulation in Chromium DevTools. - Open T3 Code in the web or desktop app.
- Press Tab to move keyboard focus through buttons, switches, toggles, select dropdowns, text inputs, sidebar thread rows, and the Appearance settings sliders.
- In a normal theme as well, press Tab into the chat composer editor, a filled primary button, and a checked switch.
Expected behavior#
Every interactive control should show a clear, high-contrast keyboard focus indicator in both Windows contrast themes and normal themes, meeting WCAG 2.1 SC 2.4.7 (Focus Visible, which requires a clearly visible focus indicator) and SC 1.4.11 (Non-text Contrast, at least 3:1).
Actual behavior#
A low vision user who navigates with a keyboard in a Windows contrast theme (a system high-contrast mode, known in CSS as forced-colors) is likely to see no focus indicator at all on most controls. This came up in a low vision audit prompted by a user who found highlighting hard to see; we don't yet know whether that user runs a Windows contrast theme.
Most shared UI primitives strip the browser's focus outline (outline-none) and draw keyboard focus using a CSS box-shadow (a decorative shadow effect, via Tailwind's focus-visible:ring-* utilities). Windows contrast themes strip box-shadow rules, leaving nothing visible when these controls receive keyboard focus. The settings sliders also set outline: none on :focus-visible; although index.css already has a @media (forced-colors: active) block that reverts the slider track and thumb, it does not restore the focus outline. By contrast, checkbox.tsx and radio-group.tsx use a real focus-visible:outline-2, which survives forced colors.
Two closely related focus gaps also affect normal themes:
- Chat composer: The TipTap editor sets
outline: noneon:focus, and the surroundingComposerSurfaceadds no visual change when keyboard focus is inside it. - Filled primary buttons and checked switches: Both draw an inset
focus-visible:ring-ringover abg-primarybackground, where--ringis defined asvar(--primary)— drawing the same colour on top of itself and leaving little visible change.
Unverified: Actual rendering under Windows contrast themes has not been checked in the running app yet; verify with a real Windows contrast theme or Chromium DevTools forced-colors: active emulation.
Where it comes from
apps/web/src/components/ui/button.tsx:9—outline-nonewithfocus-visible:ring-*(and filled primarybg-primaryat line46).apps/web/src/components/ui/switch.tsx:14—outline-nonewithfocus-visible:ring-*overdata-checked:bg-primary.apps/web/src/components/ui/toggle.tsx:7—outline-nonewithfocus-visible:ring-*.apps/web/src/components/ui/select.tsx:23,32,34—outline-nonewithfocus-visible:ring-*.apps/web/src/components/ui/input.tsx:22,64—outline-noneon the input andhas-focus-visible:ring-[3px]on the wrapper.apps/web/src/components/sidebar/SidebarThreadRow.tsx:1141—outline-nonewithfocus-visible:ring-2.apps/web/src/index.css:1085-1117—.settings-slider:focus-visiblesetsoutline: noneand draws thumb focus withbox-shadow; the@media (forced-colors: active)block at lines1101-1117reverts track and thumb styles without restoringoutline.apps/web/src/index.css:2603-2606andapps/web/src/components/chat/ComposerSurface.tsx—.composer-tiptap:focusremoves the outline andComposerSurfacehas nofocus-withinstate.apps/web/src/index.css:1195—--ring: var(--primary).- Working reference in this repo:
apps/web/src/components/ui/checkbox.tsx:6andapps/web/src/components/ui/radio-group.tsx:20usefocus-visible:outline-2.
Suggested direction
- Replace
outline-none+box-shadowfocus rings in the shared primitives with a real CSSoutline(either a transparent outline viaoutline-hiddenthat forced colors turns visible, orfocus-visible:outline-2as incheckbox.tsxandradio-group.tsx), and restoreoutlineon.settings-slider:focus-visibleunder forced colors. - Add
Highlight-coloured outlines for focus and selected/highlighted states inside@media (forced-colors: active). - Add a visible
focus-withinindicator onComposerSurface. - Use a contrasting focus ring colour or outer offset on filled primary buttons and checked switches.
Impact#
Major degradation or frequent failure
Version or commit#
0.1.13, main @ ca36afaeb1d
Environment#
Web and desktop (shared apps/web UI). Found by reading the source at ca36afaeb1d; actual rendering under Windows contrast themes (forced-colors: active) has not been measured in the running app. Mobile was not checked (it does not use these components).
Logs or stack traces#
No response
Screenshots, recordings, or supporting files#
No response
Workaround#
None in Windows contrast themes; keyboard users cannot reliably see which control is focused.
Drafted by Gemini 4 Neon and reviewed by Claude Opus 5.5 in T3 Code.
akj(GitHub profile, opens in a new tab) added labelsbug
akj(GitHub profile, opens in a new tab) added labelsneeds-triage
Sign in to join this conversation.