Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions packages/docs-theme/scripts/brand.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
10 changes: 10 additions & 0 deletions packages/docs-theme/src/brand.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading