|
| 1 | +/* Sidebar hierarchy + density for MkDocs Material 9.7.x. |
| 2 | + All rules scoped to the desktop sidebar breakpoint (>= 76.25em), matching |
| 3 | + Material's own scoping for navigation.sections, so the mobile drill-down |
| 4 | + drawer keeps stock styling. Colors use Material tokens, so the light and |
| 5 | + slate schemes both work without extra palette handling. */ |
| 6 | + |
| 7 | +@media screen and (min-width: 76.25em) { |
| 8 | + /* Section labels: smaller, uppercase, letter-spaced, muted. Covers both the |
| 9 | + clickable index-page headers and the bare API Reference label. */ |
| 10 | + .md-sidebar--primary .md-nav__item--section > .md-nav__link { |
| 11 | + font-size: 0.62rem; |
| 12 | + font-weight: 700; |
| 13 | + text-transform: uppercase; |
| 14 | + letter-spacing: 0.1em; |
| 15 | + color: var(--md-default-fg-color--light); |
| 16 | + } |
| 17 | + |
| 18 | + /* Indent section children and hang a guide line. Material outdents section |
| 19 | + children with [dir=ltr] ... margin-left: -0.6rem, which is why they sit |
| 20 | + flush under the header; restoring the margin re-exposes the stock 0.6rem |
| 21 | + list padding. The logical property ties Material's physical one at |
| 22 | + (0,3,0) specificity and wins on source order (extra_css loads last), |
| 23 | + while staying direction-agnostic. */ |
| 24 | + .md-sidebar--primary .md-nav__item--section > .md-nav { |
| 25 | + margin-inline-start: 0.1rem; |
| 26 | + border-inline-start: 0.05rem solid var(--md-default-fg-color--lightest); |
| 27 | + } |
| 28 | + |
| 29 | + /* Same guide line for collapsible groups inside the API Reference subtree |
| 30 | + (section items also carry --nested, so exclude them). */ |
| 31 | + .md-sidebar--primary .md-nav__item--nested:not(.md-nav__item--section) > .md-nav { |
| 32 | + border-inline-start: 0.05rem solid var(--md-default-fg-color--lightest); |
| 33 | + } |
| 34 | + |
| 35 | + /* Tighten vertical rhythm (stock: 0.625em link margins, 1.25em sections). |
| 36 | + The child combinator keeps this off anchors inside md-nav__container, |
| 37 | + which carry their own margin-top: 0 stock rule. */ |
| 38 | + .md-sidebar--primary .md-nav__item > .md-nav__link { |
| 39 | + margin-top: 0.45em; |
| 40 | + } |
| 41 | + .md-sidebar--primary .md-nav__item--section { |
| 42 | + margin: 1em 0; |
| 43 | + } |
| 44 | + .md-sidebar--primary .md-nav__item--section > .md-nav__link { |
| 45 | + margin-top: 0; |
| 46 | + } |
| 47 | + |
| 48 | + /* The current page stands out from its siblings. 700 because Material only |
| 49 | + loads Inter at 300/400/700; a 600 would silently substitute the 700 face |
| 50 | + anyway, but render lighter on the system-font fallback stack. */ |
| 51 | + .md-sidebar--primary .md-nav__link--active { |
| 52 | + font-weight: 700; |
| 53 | + } |
| 54 | + |
| 55 | + /* The sidebar repeats the site name right above the homepage nav entry; |
| 56 | + drop the title row on desktop (the mobile drawer still needs it for its |
| 57 | + drill-down back-navigation, hence the media-query scope). */ |
| 58 | + .md-sidebar--primary .md-nav--primary > .md-nav__title { |
| 59 | + display: none; |
| 60 | + } |
| 61 | +} |
| 62 | + |
| 63 | +/* Headings: Material's 300-weight light-gray defaults read washed out; use |
| 64 | + the full foreground color and a solid weight instead. 700, not 600: the |
| 65 | + Google Fonts request only carries Inter 300/400/700 (see the nav__link |
| 66 | + note above). */ |
| 67 | +.md-typeset h1, |
| 68 | +.md-typeset h2 { |
| 69 | + font-weight: 700; |
| 70 | + color: var(--md-default-fg-color); |
| 71 | +} |
| 72 | +.md-typeset h3 { |
| 73 | + font-weight: 700; |
| 74 | +} |
0 commit comments