site: the docs bar keeps every link on one line instead of stacking it a character per line

Between 1000px and ~1300px the docs nav's links shrank to fit, so 快速上手
and "Get started" wrapped into columns of characters and the bar grew
two lines tall (owner's screenshot, zh docs). The links now never wrap
inside themselves (white-space: nowrap), the brand keeps its width, and
the link row is one 22px line: a link that doesn't fit wraps onto a
second line the bar clips. This fits every language without a per-language
breakpoint; the contents still list every page.

Run: served site/public locally and shot /docs/{zh,en,ja}/start in
headless Chrome at 1010, 1120, 1300 and 1500px: one line each, no clipped
half-links, buttons untouched. node --test site/*.test.mjs passes.
This commit is contained in:
yetone
2026-10-13 18:27:27 +08:00
parent efc305a375
commit 71f796069f
+4 -3
View File
@@ -63,11 +63,12 @@ code, pre, kbd, .mono { font-family: ui-monospace, "SF Mono", "JetBrains Mono",
nav { position: sticky; top: 0; z-index: 10; backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid var(--line); }
nav .wrap { display: flex; align-items: center; gap: 14px; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 17px; letter-spacing: -.01em; text-decoration: none; }
.brand { flex: none; white-space: nowrap; display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 17px; letter-spacing: -.01em; text-decoration: none; }
.brand img { width: 24px; height: 24px; }
.brand small { font-weight: 500; color: var(--ink3); font-size: 15px; padding-left: 10px; margin-left: 2px; border-left: 1px solid var(--line); }
nav .links { display: flex; gap: 24px; margin-left: auto; margin-right: 10px; font-size: 14px; color: var(--ink2); }
nav .links a { text-decoration: none; }
/* one line only: a link that doesn't fit wraps onto a second line the bar clips, never into a column of characters */
nav .links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 40px 24px; min-width: 0; height: 22px; line-height: 22px; overflow: hidden; margin-left: auto; margin-right: 10px; font-size: 14px; color: var(--ink2); }
nav .links a { text-decoration: none; white-space: nowrap; }
nav .links a:hover { color: var(--ink); }
/* listed in the contents (docs.js reads them from here) but kept out of the bar, which has no room */
nav .links a.toc-only { display: none; }