Skip to content

Commit de9d8fa

Browse files
committed
docs: align top-level nav pages and the API Reference label flush left
Top-level pages outside any section kept the pill's left padding plus a stock margin, sitting 14px right of the section labels; pull their box left by the pill inset so text lines up and the active pill overhangs the gutter. The API Reference label (the one section without an index page, rendered as a label element rather than a container div) was still caught by the density rule via :not() specificity — exclude section items from the density rules outright instead of relying on source order.
1 parent 7d3d1dd commit de9d8fa

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

docs/extra.css

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
and active highlight, just denser. Group rows that link to an index
1212
page wrap their anchor in an .md-nav__container div whose stock
1313
padding is 0 — densify the inner anchor, not the wrapper. The
14-
section-label rules below must come AFTER these: they win the
15-
specificity tie on source order. */
16-
.md-sidebar--primary .md-nav__item > .md-nav__link:not(.md-nav__container) {
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) {
1718
padding: 4px 10px;
1819
margin-top: 2px;
1920
}
20-
.md-sidebar--primary .md-nav__item > .md-nav__container {
21+
.md-sidebar--primary .md-nav__item:not(.md-nav__item--section) > .md-nav__container {
2122
margin-top: 2px;
2223
}
2324
.md-sidebar--primary .md-nav__container > .md-nav__link {
@@ -34,7 +35,7 @@
3435
.md-sidebar--primary .md-nav__item--section > .md-nav__link {
3536
margin-top: 0;
3637
margin-left: 0;
37-
padding-left: 0;
38+
padding: 2px 0;
3839
font-size: 0.62rem;
3940
font-weight: 700;
4041
text-transform: uppercase;
@@ -63,6 +64,14 @@
6364
font-weight: 700;
6465
}
6566

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+
6675
/* The sidebar repeats the site name right above the homepage nav entry;
6776
drop the title row on desktop (the mobile drawer still needs it for its
6877
drill-down back-navigation, hence the media-query scope). */

0 commit comments

Comments
 (0)