MediaWiki:Common.css: Difference between revisions
Content deleted Content added
No edit summary |
No edit summary |
||
Line 1,586:
:focus-visible { outline-color: var(--ed-link); }
/* ── TOC sidebar —
Every entry, ANY level, starts on ONE left axis: the section
NO number gutter, NO absolute positioning (the old gutter geometry
is gone). The ONE structural rule is a hanging indent on every li
align under the TITLE. Nested <ul>s are pulled back by the same
--toc-hang so level-2+ numbers
staircase). "Beginning" (the one entry MediaWiki leaves unnumbered)
house triangle ▸/▾ INLINE after the heading text. The CONTENTS▼
gets a generated inline "0.". Expand/collapse is the house triangle
the number axis.
CALIBRATION: --toc-hang is the wrap-indent / number budget — size
it to the title-start of the entries that actually wrap (level-2,
.vector-toc {
font-family: var(--ed-sans);
--toc-hang: 2.6em; /* hanging indent = number budget + gap to title */
--toc-header-inset: 0
}
.vector-toc .vector-toc-list-item.vector-toc-level-2 { --toc-numb-gutter: 2.8rem; }▼
/* CONTENTS header: label + 1px ink rule on the title rule's line
Line 1,633 ⟶ 1,630:
}
/* entries: quiet sans at the ONE small size
the faint ink so subsections group under their parent WITHOUT any indent;
hover + active go to full ink. All four colour rules share the same
(0,3,0) specificity with !important, so SOURCE ORDER breaks the ties:
base → children → hover → active (later wins) — keep them in this order. */
.vector-toc .vector-toc-link,
.vector-toc .vector-toc-link:visited {
Line 1,639 ⟶ 1,640:
font-size: var(--ed-small);
text-decoration: none;
}
.vector-toc .vector-toc-level-3 > .vector-toc-link,
.vector-toc .vector-toc-level-4 > .vector-toc-link {
color: var(--ed-faint) !important;
}
.vector-toc .vector-toc-link:hover { color: var(--ed-ink) !important; }
.vector-toc .vector-toc-list-item-active > .vector-toc-link {
color: var(--ed-ink) !important;
font-weight: 500 !important; /* "current" without shouting; tames Vector's bold */
}
/* lists flush on the component edge;
.vector-toc .vector-toc-contents,
.vector-toc .vector-toc-list {
Line 1,651 ⟶ 1,660:
}
.vector-toc .vector-toc-list-item {
position: relative; /* the number's anchor */▼
text-indent: calc(-1 * var(--toc-hang)); /* first line out to the axis;
▲ padding: 0.22rem 0 0.22rem var(--toc-numb-gutter) !important;
font-size: var(--ed-small);▼
▲ number ~1px above the 13px text */
}
/* pull each NESTED list back by one hang so level-2+ numbers land on the
SAME left axis as level-1 — this is what makes the layout flat (the li's
own padding offsets its content box; this cancels it for the children) */
margin-top: 0.1rem;
margin-left: calc(-1 * var(--toc-hang));
}
▲.vector-toc .vector-toc-list-item > .vector-toc-list { margin-top: 0.1rem; }
/* the numbers: inline, flowing straight into the title as one run */
.vector-toc .vector-toc-numb {
display:
margin-right: 0.4em; /* the only gap to the title (DOM has none) */
font-variant-numeric: tabular-nums;
}
.vector-toc .vector-toc-numb::after { content: "."; }
/* "0." for Beginning —
(mirrors the active-link rule above) */
.vector-toc #toc-mw-content-text::before {
content: "0.";
margin-right: 0.4em;
white-space: nowrap;
font-variant-numeric: tabular-nums;
color: var(--ed-secondary);
▲ font-size: var(--ed-small);
}
.vector-toc #toc-mw-content-text.vector-toc-list-item-active::before {
color: var(--ed-ink);
font-weight:
}
| |||