Skip to content

Commit 61e0d36

Browse files
committed
style(site): file-block header path as a proper section title + menu close on nav
Two fixes: 1. File path on each file-block header (e.g. `src/package-url-builder.ts`) now renders at 22px / 600 — a hero for the entire code+prose stack below it, not a tiny 13px line. Still monospace because it IS a file path, not prose. Section count sibling bumped to 14px / --muted so the metadata stays quiet next to it. 2. Section + files dropdowns close after the user picks an entry from their panel. Delegated click handler on document catches `.wt-sections-panel a` and `.wt-files-panel a`, then sets .open = false on every open .wt-sections-menu / .wt-files-menu. Without this, clicking a link jumped the page but left the panel floating on top of the content it just scrolled to.
1 parent 8abe42f commit 61e0d36

2 files changed

Lines changed: 35 additions & 8 deletions

File tree

drag.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,22 @@
568568
panel.scrollTop += centerOffset
569569
})
570570
}
571+
/* Close any open sections/files menu after the user picks
572+
* an entry from its panel. Without this, clicking a link
573+
* leaves the floating dropdown open on top of the content
574+
* it just jumped to. Delegated on document so chips that
575+
* hydrate lazily are covered too. */
576+
document.addEventListener('click', e => {
577+
const link = e.target.closest?.('.wt-sections-panel a, .wt-files-panel a')
578+
if (!link) {
579+
return
580+
}
581+
for (const menu of document.querySelectorAll(
582+
'.wt-sections-menu[open], .wt-files-menu[open]',
583+
)) {
584+
menu.open = false
585+
}
586+
})
571587
}
572588

573589
/* Cmd/Ctrl-click links inside code lines. Two flavors:

overrides.css

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,15 +1202,21 @@ html:not([data-ua='safari']) .file-block {
12021202
border-bottom: 1px solid var(--border);
12031203
}
12041204

1205+
/* File path on each file-block header — the "this section is
1206+
* about <file>" title. Larger + heavier than the TOC-title
1207+
* scale (18px/600) so it reads as a hero for the entire
1208+
* code+prose stack below, not just another body heading.
1209+
* Monospace because it's a file path, literal text. */
12051210
.file-head .path {
12061211
font-family: var(--font-mono);
1207-
font-size: 13px;
1208-
font-weight: 500;
1212+
font-size: 22px;
1213+
font-weight: 600;
12091214
color: var(--ink);
1215+
letter-spacing: -0.01em;
12101216
}
12111217

12121218
.file-head .count {
1213-
font-size: 12px;
1219+
font-size: 14px;
12141220
color: var(--muted);
12151221
}
12161222

@@ -1686,12 +1692,17 @@ body.col-resizing * {
16861692

16871693
/* JSDoc tag marker (@param, @returns, @throws, @example, …).
16881694
* Set in annotation prose by drag.js's cleanupAnnotationProse
1689-
* after meander hydrates. Same size + family as surrounding
1690-
* prose so the tag still reads as inline text; just dimmer so
1691-
* it recedes as metadata rather than fighting the primary
1692-
* content. */
1695+
* after meander hydrates. Distinctive from surrounding prose —
1696+
* always a tinted accent color + non-italic, since the first
1697+
* annotation-card on each file-block is rendered in italic
1698+
* muted prose (so "dimmer than body" wouldn't stand out there).
1699+
* Using the accent token works across every theme + both
1700+
* card-ordinal treatments. */
16931701
.wt-jsdoc-tag {
1694-
color: var(--muted);
1702+
color: var(--accent-fg);
1703+
font-style: normal;
1704+
font-weight: 500;
1705+
opacity: 0.75;
16951706
}
16961707

16971708
/* ── 8. Code / diff tables ───────────────────────────────────────── */

0 commit comments

Comments
 (0)