Skip to content

Commit a2f9108

Browse files
committed
fix: update monospace font-sace for fenced code block
1 parent 4534824 commit a2f9108

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

‎src/generators/web/ui/index.css‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,27 @@ main {
1616
word-break: break-word;
1717
}
1818

19+
/*
20+
* Fenced code blocks use a system monospace stack instead of IBM Plex Mono.
21+
* Plex has no glyphs for the Unicode Box Drawing block (U+2500–U+257F) and
22+
* Google Fonts never serves that block, so the box-drawing characters in
23+
* ASCII-art diagrams (e.g. the URL table in url.md) fall back per-glyph to
24+
* the OS default monospace. On Windows that is Consolas (0.55em) while Plex
25+
* letters are 0.60em; the mismatched advance widths shear the diagram out of
26+
* alignment. Rendering the whole block in one system font keeps every glyph
27+
* the same width — the same stack nodejs.org and the legacy-html generator
28+
* already use. See https://github.com/nodejs/doc-kit/issues/909.
29+
*
30+
* This only overrides the variable within `pre`, so inline code and the rest
31+
* of the UI keep IBM Plex Mono. The variable keeps its name because the
32+
* compiled @node-core/ui-components CSS reads `var(--font-ibm-plex-mono)`.
33+
*/
34+
pre {
35+
--font-ibm-plex-mono:
36+
'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', 'Courier New',
37+
monospace;
38+
}
39+
1940
/* Don't overflow the parent */
2041
.overflow-container {
2142
overflow-x: auto;

0 commit comments

Comments
 (0)