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) {