MediaWiki:Gadget-autoNumberHeadings.css: Difference between revisions
Jump to navigation
Jump to search
Just the JS part as we don't want it without a TOC anyway. |
Add print numbers so guides print with correct numbers. |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
/** | /** | ||
* Auto-number headings | * Modified Auto-number headings | ||
* | * | ||
* @source https://www.mediawiki.org/wiki/Snippets/Auto-number_headings | * @source https://www.mediawiki.org/wiki/Snippets/Auto-number_headings | ||
*/ | */ | ||
| Line 11: | Line 9: | ||
* and we display that instead of an automatic counter. | * and we display that instead of an automatic counter. | ||
*/ | */ | ||
.tpl-autonum-attr .mw-parser-output | .tpl-autonum-attr .mw-parser-output h1[data-autonum]::before, | ||
.tpl-autonum-attr .mw-parser-output h2[data-autonum]:before , | .tpl-autonum-attr .mw-parser-output h2[data-autonum]::before, | ||
.tpl-autonum-attr .mw-parser-output h3[data-autonum]:before , | .tpl-autonum-attr .mw-parser-output h3[data-autonum]::before, | ||
.tpl-autonum-attr .mw-parser-output h4[data-autonum]:before , | .tpl-autonum-attr .mw-parser-output h4[data-autonum]::before, | ||
.tpl-autonum-attr .mw-parser-output h5[data-autonum]:before , | .tpl-autonum-attr .mw-parser-output h5[data-autonum]::before, | ||
.tpl-autonum-attr .mw-parser-output h6[data-autonum]:before { | .tpl-autonum-attr .mw-parser-output h6[data-autonum]::before { | ||
content: attr(data-autonum) " "; | |||
font-weight: bold; | |||
} | |||
/* PRINT STYLE: Force numbers to show inside the TOC when printing */ | |||
@media print { | |||
#toc .tocnumber { | |||
display: inline-block !important; | |||
margin-right: 0.3em; | |||
} | |||
} | } | ||
Latest revision as of 05:36, 6 November 2026
/**
* Modified Auto-number headings
*
* @source https://www.mediawiki.org/wiki/Snippets/Auto-number_headings
*/
/**
* JS mode: When a TOC is present, autonum.js sets the data-autonum attribute
* and we display that instead of an automatic counter.
*/
.tpl-autonum-attr .mw-parser-output h1[data-autonum]::before,
.tpl-autonum-attr .mw-parser-output h2[data-autonum]::before,
.tpl-autonum-attr .mw-parser-output h3[data-autonum]::before,
.tpl-autonum-attr .mw-parser-output h4[data-autonum]::before,
.tpl-autonum-attr .mw-parser-output h5[data-autonum]::before,
.tpl-autonum-attr .mw-parser-output h6[data-autonum]::before {
content: attr(data-autonum) " ";
font-weight: bold;
}
/* PRINT STYLE: Force numbers to show inside the TOC when printing */
@media print {
#toc .tocnumber {
display: inline-block !important;
margin-right: 0.3em;
}
}