From 617b365fb7d8e0a3ffbf837171be064f8624d955 Mon Sep 17 00:00:00 2001 From: Nick Vigilante Date: Mon, 30 Nov 2026 18:53:27 +0000 Subject: [PATCH] fix(docs-theme): wrap long inline code on API pages with a full border per line Long values such as a search query's filter syntax ran past the card edge, and a value that wrapped drew a border only on its first and last fragments, leaving a split box. Inline code on an API page now breaks anywhere and clones its padding and border onto every line. Assisted-by: AI --- packages/docs-theme/scripts/brand.test.mjs | 6 ++++++ packages/docs-theme/src/brand.css | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/packages/docs-theme/scripts/brand.test.mjs b/packages/docs-theme/scripts/brand.test.mjs index 2e9a2f3e..6106ab76 100644 --- a/packages/docs-theme/scripts/brand.test.mjs +++ b/packages/docs-theme/scripts/brand.test.mjs @@ -64,3 +64,9 @@ test("an API page's endpoint route wraps instead of scrolling", () => { assert.equal(declared["white-space"], "normal"); assert.equal(declared["overflow-wrap"], "anywhere"); }); + +test("an API page's inline code wraps inside its container and keeps a full border on every line", () => { + const declared = declarationsFor(".coder-api-page :not(pre) > code"); + assert.equal(declared["overflow-wrap"], "anywhere"); + assert.equal(declared["box-decoration-break"], "clone"); +}); diff --git a/packages/docs-theme/src/brand.css b/packages/docs-theme/src/brand.css index e3dd2fe3..82608f89 100644 --- a/packages/docs-theme/src/brand.css +++ b/packages/docs-theme/src/brand.css @@ -944,6 +944,12 @@ figure.shiki:not(.not-fumadocs-codeblock *) pre { overflow-wrap: anywhere; } +/* Long values wrap inside their cell, and each wrapped line keeps its own padding and border. */ +.coder-api-page :not(pre) > code { + overflow-wrap: anywhere; + box-decoration-break: clone; +} + /* fumadocs-openapi's method badges (on API pages, the landing cards, the sidebar and the page footer) and links are -600/-400 shades that fall short of 4.5:1 (7:1 for More contrast). */ :root:not(.dark) :is(.coder-api-page, .coder-api-cards, #nd-sidebar, #nd-sidebar-mobile, #nd-page > footer) {