|
6 | 6 | extra palette handling. */ |
7 | 7 |
|
8 | 8 | @media screen and (min-width: 76.25em) { |
9 | | - /* Tighten vertical rhythm: the stock pill rows (7px 16px padding plus |
10 | | - 6.3px top margins) read too airy for a deep nav; keep the pill shape |
11 | | - and active highlight, just denser. Group rows that link to an index |
12 | | - page wrap their anchor in an .md-nav__container div whose stock |
13 | | - padding is 0 — densify the inner anchor, not the wrapper. The |
14 | | - section items are excluded outright: their label is styled by the |
15 | | - section rules below, and the :not() classes here would otherwise |
16 | | - out-rank those on specificity. */ |
17 | | - .md-sidebar--primary .md-nav__item:not(.md-nav__item--section) > .md-nav__link:not(.md-nav__container) { |
18 | | - padding: 4px 10px; |
19 | | - margin-top: 2px; |
| 9 | + /* The sidebar is one coordinate system derived from the pill inset: |
| 10 | + every row — page links, group rows, section labels — is a direct |
| 11 | + .md-nav__link child of its item with the same 10px horizontal padding, |
| 12 | + so all text shares one column, and hover/active pills always paint |
| 13 | + 10px of breathing room inside the scroll container (never clipped). |
| 14 | + Inner anchors inside .md-nav__container wrappers are zeroed; the row |
| 15 | + box owns the geometry. Vertical rhythm has a single knob: the nav |
| 16 | + list's flex gap (stock 0.2rem reads airy; 2px matches the density the |
| 17 | + site shipped with on Material, ~30px row pitch). */ |
| 18 | + .md-sidebar--primary .md-nav__list { |
| 19 | + gap: 2px; |
20 | 20 | } |
21 | | - .md-sidebar--primary .md-nav__item:not(.md-nav__item--section) > .md-nav__container { |
22 | | - margin-top: 2px; |
| 21 | + .md-sidebar--primary .md-nav__item > .md-nav__link { |
| 22 | + padding: 3px 10px; |
| 23 | + margin: 0; |
23 | 24 | } |
24 | 25 | .md-sidebar--primary .md-nav__container > .md-nav__link { |
25 | | - padding: 4px 10px; |
| 26 | + padding: 0; |
| 27 | + margin: 0; |
26 | 28 | } |
| 29 | + |
| 30 | + /* Section labels: typography only — geometry comes from the row rule |
| 31 | + above, so no specificity coordination is needed. */ |
27 | 32 | .md-sidebar--primary .md-nav__item--section { |
28 | | - margin: 1em 0; |
| 33 | + margin: 0.8em 0; |
29 | 34 | } |
30 | | - |
31 | | - /* Section labels: smaller, uppercase, letter-spaced, muted, and flush |
32 | | - with the guide line below them. The label is a container whose inner |
33 | | - anchor carries the stock pill padding; zero both so the label text |
34 | | - starts at the section's left edge. */ |
35 | 35 | .md-sidebar--primary .md-nav__item--section > .md-nav__link { |
36 | | - margin-top: 0; |
37 | | - margin-left: 0; |
38 | | - padding: 2px 0; |
39 | 36 | font-size: 0.62rem; |
40 | 37 | font-weight: 700; |
41 | 38 | text-transform: uppercase; |
42 | 39 | letter-spacing: 0.1em; |
43 | 40 | color: var(--md-default-fg-color--light); |
44 | 41 | } |
45 | | - .md-sidebar--primary .md-nav__item--section > .md-nav__link > a { |
46 | | - padding: 2px 0; |
47 | | - } |
48 | 42 |
|
49 | | - /* Indent section children slightly and hang a guide line. */ |
| 43 | + /* Guide lines: 12px from the item box = 2px right of the label text |
| 44 | + (which sits at box + 10px pill inset); children indent past them. */ |
50 | 45 | .md-sidebar--primary .md-nav__item--section > .md-nav { |
51 | | - margin-inline-start: 0.1rem; |
| 46 | + margin-inline-start: 12px; |
52 | 47 | border-inline-start: 0.05rem solid var(--md-default-fg-color--lightest); |
53 | 48 | } |
54 | | - |
55 | | - /* Same guide line for collapsible groups inside the API Reference subtree |
56 | | - (section items also carry --nested, so exclude them). */ |
57 | 49 | .md-sidebar--primary .md-nav__item--nested:not(.md-nav__item--section) > .md-nav { |
| 50 | + margin-inline-start: 12px; |
58 | 51 | border-inline-start: 0.05rem solid var(--md-default-fg-color--lightest); |
59 | 52 | } |
60 | 53 |
|
|
64 | 57 | font-weight: 700; |
65 | 58 | } |
66 | 59 |
|
67 | | - /* Top-level pages outside any section (the homepage entry, Protocol |
68 | | - versions, Troubleshooting, ...) share the left edge with the section |
69 | | - labels: pull the link box left by its own pill padding, so the text |
70 | | - is flush and the hover/active pill overhangs into the gutter. */ |
71 | | - .md-sidebar--primary .md-nav--primary > .md-nav__list > .md-nav__item:not(.md-nav__item--section) > .md-nav__link:not(.md-nav__container) { |
72 | | - margin-inline-start: -10px; |
73 | | - } |
74 | | - |
75 | 60 | /* The sidebar repeats the site name right above the homepage nav entry; |
76 | 61 | drop the title row on desktop (the mobile drawer still needs it for its |
77 | 62 | drill-down back-navigation, hence the media-query scope). */ |
|
0 commit comments