Skip to content

Commit 2665954

Browse files
committed
style(site): shrink annotation prose + extend menu-close dismissal
Annotation body text was 15px with heading children at 18px — against the 12px dropdown-menu items, prose dominated and the nav felt miniaturized. Drop body to 13px and headings to 15px so the hierarchy reads: 28px/700 — file-head path (file-block hero) 15px/600 — annotation h1-h4 (sub-headings inside prose) 13px — annotation body + dropdown menu items (peers) 12px — sections panel rows (index labels) Menu + body share a visual weight; file path dominates. Also extended the menu-close click handler to cover three dismissal cases: panel-link click (nav jump), outside- everything click (blur), and open-another-menu click (current one steps aside so two dropdowns don't stack).
1 parent 8446efd commit 2665954

2 files changed

Lines changed: 25 additions & 12 deletions

File tree

drag.js

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -568,20 +568,33 @@
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. */
571+
/* Close open sections/files menus when:
572+
* 1. the user picks a link inside a panel (nav jump),
573+
* 2. the user clicks outside every menu (blur),
574+
* 3. the user opens a different menu (the currently
575+
* open one should step aside so two dropdowns don't
576+
* stack on the page).
577+
* Delegated on document so chips that hydrate lazily are
578+
* covered. A click INSIDE an open menu that isn't the
579+
* summary or a panel link (e.g. scrolling a long panel,
580+
* empty-space inside the popover) leaves it open. */
576581
document.addEventListener('click', e => {
577-
const link = e.target.closest?.('.wt-sections-panel a, .wt-files-panel a')
578-
if (!link) {
579-
return
580-
}
582+
const target = e.target
583+
const panelLink = target.closest?.(
584+
'.wt-sections-panel a, .wt-files-panel a',
585+
)
586+
const summary = target.closest?.(
587+
'.wt-sections-menu > summary, .wt-files-menu > summary',
588+
)
589+
const clickedMenu = summary?.parentElement
590+
const insideMenu = target.closest?.('.wt-sections-menu, .wt-files-menu')
591+
const closeAll = panelLink || (!insideMenu && !summary)
581592
for (const menu of document.querySelectorAll(
582593
'.wt-sections-menu[open], .wt-files-menu[open]',
583594
)) {
584-
menu.open = false
595+
if (closeAll || (summary && menu !== clickedMenu)) {
596+
menu.open = false
597+
}
585598
}
586599
})
587600
}

overrides.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,7 +1640,7 @@ body.col-resizing * {
16401640
.annotation-md h2,
16411641
.annotation-md h3,
16421642
.annotation-md h4 {
1643-
font-size: 18px;
1643+
font-size: 15px;
16441644
font-weight: 600;
16451645
letter-spacing: -0.01em;
16461646
line-height: 1.3;
@@ -1669,7 +1669,7 @@ body.col-resizing * {
16691669

16701670
.annotation-md {
16711671
color: var(--body);
1672-
font-size: 15px;
1672+
font-size: 13px;
16731673
line-height: 1.6;
16741674
}
16751675

0 commit comments

Comments
 (0)