Repository navigation
fix(docs-theme): show one focus ring on the API property filter - #416
Merged
Merged
Conversation
The Fumadocs OpenAPI schema panel's "Filter Properties" field draws a 1px ring on its label and relies on a Tailwind outline-none on the input. brand.css is unlayered, so the global input focus outline beat that utility and the focused field got a second, 2px outline inside the ring. The label now carries the one indicator, a 2px outline matching the site's focus style that forced-colors keeps, and the library's box-shadow ring and the input's own outline are dropped. Assisted-by: AI
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
nickvigilante
had a problem deploying
to
docs-preview
November 25, 2026 17:56 — with
GitHub Actions
Failure
Assisted-by: AI
…focus # Conflicts: # packages/docs-theme/scripts/brand.test.mjs
Docs preview deploymentRendered with docs-engine d6cd080 from coder/coder at 6bd3e2d1b01e3db5e835ed30bc7fecd643ee589b: https://coder-docs-3oqw5u80y.coderite.app The preview is behind Vercel authentication; sign in with your Coder Vercel account. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge order
Independent.
Summary
Clicking or tabbing into "Filter Properties" in an API operation's request or response schema panel showed two focus indicators, one on the box and one on the inner text field. It now shows one, on the box.
Fix
The field is fumadocs-openapi 12.6.1's own schema UI: a
label(focus-within:ring-1 focus-within:ring-fd-ring, a 1px box-shadow) containing aninputwith the Tailwind utilityoutline-none.brand.cssis imported unlayered, and unlayered CSS beats@layer utilitieswhatever the specificity, so the global:where(a, button, input, summary, [tabindex]):focus-visible { outline: 2px solid var(--color-fd-ring) }overrodeoutline-noneand outlined the input inside the label's ring.I chose the label as the single indicator, scoped to
.coder-api-page:label:has(> input:focus-visible)gets the same 2px ring-colour outline as the rest of the site, withbox-shadow: noneto drop the library's ring, andlabel > input:focus-visiblegetsoutline: none. The field is a text input, so:focus-visiblematches on mouse click as well as keyboard, as it did before. Accessibility: exactly one visible indicator; the ring colour is the site's existing focus token, which is already covered by the contrast check (contrast:checkpasses: standard 81/81 AA, More 81/81 AAA); More contrast uses the same token's More value; a real outline (unlike the box-shadow ring, which forced-colors mode removes) stays visible in forced-colors mode, so this also fixes that mode having no indicator; outline takes no space, so there is no layout shift and no border or padding change (offset 1px to keep it small).QA
Operation pages only show this after the engine is republished with the new API reference, so use the preview. Firefox steps are not verified; I had no browser here and the visual result is inferred from the CSS and library source.
Pages to compare
The preview alias always serves the latest deploy and needs a Vercel login.
docs previewcomment on this PR (branch alias ofvigilante/api-filter-focus)Testing
brand.test.mjsgained a test that pins the label's 2px ring outline withbox-shadow: noneand the input'soutline: none. It failed on the old CSS (no such rules) and passes now. All 37 docs-theme tests pass, as dopnpm lintin docs-theme (oxlint, oxfmt, Stylelint) andcontrast:check. Not run:next build(aborts under the memory cap), the axe pass, and any browser check.Upstream
Maybe. The library's input relies on
outline-noneand a 1px ring that forced-colors mode removes, which is a generic accessibility gap, but the double ring comes from our unlayered global rule. Nothing filed.No Linear issue.
🤖 Built with AI assistance.