diff --git a/packages/docs-theme/scripts/brand.test.mjs b/packages/docs-theme/scripts/brand.test.mjs index 5ea902c3..2e9a2f3e 100644 --- a/packages/docs-theme/scripts/brand.test.mjs +++ b/packages/docs-theme/scripts/brand.test.mjs @@ -31,6 +31,25 @@ test("the theme asks for no weight above Medium", () => { assert.deepEqual(heavy, []); }); +const declarationsFor = (selector) => { + const found = {}; + brand.walkRules((rule) => { + if (!rule.selectors.map(normalize).includes(selector)) return; + rule.walkDecls((decl) => { + found[decl.prop] = decl.value; + }); + }); + return found; +}; + +test("the API property filter shows one focus indicator, on its box and not its inner field", () => { + const box = declarationsFor(".coder-api-page label:has(> input:focus-visible)"); + assert.equal(box.outline, "2px solid var(--color-fd-ring)"); + assert.equal(box["box-shadow"], "none"); + const field = declarationsFor(".coder-api-page label > input:focus-visible"); + assert.equal(field.outline, "none"); +}); + test("an API page's endpoint route wraps instead of scrolling", () => { const declared = {}; brand.walkRules((rule) => { diff --git a/packages/docs-theme/src/brand.css b/packages/docs-theme/src/brand.css index 9f88b6bd..e3dd2fe3 100644 --- a/packages/docs-theme/src/brand.css +++ b/packages/docs-theme/src/brand.css @@ -1032,6 +1032,16 @@ figure.shiki:not(.not-fumadocs-codeblock *) pre { outline-offset: 2px; } +.coder-api-page label:has(> input:focus-visible) { + outline: 2px solid var(--color-fd-ring); + outline-offset: 1px; + box-shadow: none; +} + +.coder-api-page label > input:focus-visible { + outline: none; +} + .coder-schema-filter { display: grid; gap: 0.375rem;