MediaWiki:Common.css: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 1,709:
.vector-toc .vector-toc-list-item-active > .vector-toc-link { color: var(--ed-ink) !important; }
 
/* ── TOC section numbers + hanging indent (consolidatedv3, orderabsolute-proof).marker pattern — the same trick
MediaWiki computesas the numbersarticle (1,list 2, 2markers).1 …);MediaWiki Vectorcomputes shipsthe themnumbers
(1, 2, 2.1 …); Vector ships them display:none. The li reserves a
display:none. Re-shown in a FIXED gutter with a hanging indent:
numbersgutter sitvia onpadding; the leftnumber axis,is allabsolutely entrypositioned textINTO shares one axisthe
gutter (left:0, top:auto keeps it on its own first line). Entry
whether the number is 1 or 2 digits, wrapped lines align under
thetext TEXT. Thefirst gutterline tokenAND iswrapped REM,lines not emstarts at the li (bodypadding size)edge
by construction, so alignment cannot drift; no inline-block, no
and the number span (--ed-small) must measure the SAME width.
negative text-indent, no whitespace-node gaps. Gutter token in
REM; level-2 widens its own token ("2.1." is wider than "9.").
The li selector carries +1 specificity so it beats the geometry
block's `padding-left: 0 !important` regardless of paste order. ── */
.vector-toc { --toc-numb-gutter: 1.5rem4rem; }
The numb span resets text-indent: an inline-block inherits the
.vector-toc .vector-toc-list-item.vector-toc-level-2 { --toc-numb-gutter: 2rem; }
li's negative indent and would clip its own digits. ── */
.vector-toc { --toc-numb-gutter: 1.5rem; }
.vector-toc .vector-toc-contents .vector-toc-list-item,
.vector-toc .vector-toc-list-item {
padding-left: var(--toc-numb-gutter) !important;
text-indent: calc(-10; /* var(neutralize any earlier hanging--toc-numb-gutter));indent rule */
}
.vector-toc .vector-toc-numb {
position: absolute; /* anchored to the li (position:relative) */
display: inline-block;
left: 0;
min-width: var(--toc-numb-gutter);
text-indent: 0; /* do NOT inherit the li's negative indent */
font-variant-numeric: tabular-nums;
}