MediaWiki:Common.css: Difference between revisions
Jump to navigation
Jump to search
Blanked the page Tags: Blanking Manual revert Reverted |
Tag: Undo |
||
| Line 1: | Line 1: | ||
/* CSS placed here will be applied to all skins */ | |||
/** | |||
* Auto-number headings | |||
* | |||
* @source https://www.mediawiki.org/wiki/Snippets/Auto-number_headings | |||
* @author Krinkle | |||
* @version 2024-07-28 | |||
*/ | |||
/** | |||
* CSS mode: | |||
* Insert numbers on pages without a TOC. This could in principle work for all pages, | |||
* but to ensure consistency between the TOC and heading numbers we let JS follow | |||
* the TOC if there is one. | |||
*/ | |||
.tpl-autonum .mw-parser-output { | |||
counter-reset: autonum-h2 autonum-h3 autonum-h4 autonum-h5 autonum-h6 autonum-h7 autonum-h8 autonum-h9; | |||
} | |||
.tpl-autonum .mw-parser-output .mw-heading2 { | |||
counter-increment: autonum-h2; | |||
counter-reset: autonum-h3 autonum-h4 autonum-h5 autonum-h6 autonum-h7 autonum-h8 autonum-h9; | |||
} | |||
.tpl-autonum .mw-parser-output .mw-heading3 { | |||
counter-increment: autonum-h3; | |||
counter-reset: autonum-h4 autonum-h5 autonum-h6 autonum-h7 autonum-h8 autonum-h9; | |||
} | |||
.tpl-autonum .mw-parser-output .mw-heading4 { | |||
counter-increment: autonum-h4; | |||
counter-reset: autonum-h5 autonum-h6 autonum-h7 autonum-h8 autonum-h9; | |||
} | |||
.tpl-autonum .mw-parser-output .mw-heading5 { | |||
counter-increment: autonum-h5; | |||
counter-reset: autonum-h6 autonum-h7 autonum-h8 autonum-h9; | |||
} | |||
.tpl-autonum .mw-parser-output .mw-heading6 { | |||
counter-increment: autonum-h6; | |||
counter-reset: autonum-h7 autonum-h8 autonum-h9; | |||
} | |||
.tpl-autonum .mw-parser-output .mw-heading7 { | |||
counter-increment: autonum-h7; | |||
counter-reset: autonum-h8 autonum-h9; | |||
} | |||
.tpl-autonum .mw-parser-output .mw-heading8 { | |||
counter-increment: autonum-h8; | |||
counter-reset: autonum-h9; | |||
} | |||
.tpl-autonum .mw-parser-output .mw-heading9 { | |||
counter-reset: autonum-h9; | |||
} | |||
.tpl-autonum .mw-parser-output .mw-heading h2::before { | |||
content: counter(autonum-h2) " "; | |||
} | |||
.tpl-autonum .mw-parser-output .mw-heading h3::before { | |||
content: counter(autonum-h2) "." counter(autonum-h3) " "; | |||
} | |||
.tpl-autonum .mw-parser-output .mw-heading h4::before { | |||
content: counter(autonum-h2) "." counter(autonum-h3) "." counter(autonum-h4) " "; | |||
} | |||
.tpl-autonum .mw-parser-output .mw-heading h5::before { | |||
content: counter(autonum-h2) "." counter(autonum-h3) "." counter(autonum-h4) "." counter(autonum-h5) " "; | |||
} | |||
.tpl-autonum .mw-parser-output .mw-heading h6::before { | |||
content: counter(autonum-h2) "." counter(autonum-h3) "." counter(autonum-h4) "." counter(autonum-h5) "." counter(autonum-h6) " "; | |||
} | |||
.tpl-autonum .mw-parser-output .mw-heading h7::before { | |||
content: counter(autonum-h2) "." counter(autonum-h3) "." counter(autonum-h4) "." counter(autonum-h5) "." counter(autonum-h6) "." counter(autonum-h7) " "; | |||
} | |||
.tpl-autonum .mw-parser-output .mw-heading h8::before { | |||
content: counter(autonum-h2) "." counter(autonum-h3) "." counter(autonum-h4) "." counter(autonum-h5) "." counter(autonum-h6) "." counter(autonum-h7) "." counter(autonum-h8) " "; | |||
} | |||
.tpl-autonum .mw-parser-output .mw-heading h9::before { | |||
content: counter(autonum-h2) "." counter(autonum-h3) "." counter(autonum-h4) "." counter(autonum-h5) "." counter(autonum-h6) "." counter(autonum-h7) "." counter(autonum-h8) "." counter(autonum-h8) " "; | |||
} | |||
/** | |||
* 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 .mw-headline[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 , | |||
.tpl-autonum-attr .mw-parser-output h7[data-autonum]:before , | |||
.tpl-autonum-attr .mw-parser-output h8[data-autonum]:before , | |||
.tpl-autonum-attr .mw-parser-output h9[data-autonum]:before { | |||
content: attr(data-autonum) " "; | |||
} | |||
Revision as of 01:03, 3 October 2025
/* CSS placed here will be applied to all skins */
/**
* Auto-number headings
*
* @source https://www.mediawiki.org/wiki/Snippets/Auto-number_headings
* @author Krinkle
* @version 2024-07-28
*/
/**
* CSS mode:
* Insert numbers on pages without a TOC. This could in principle work for all pages,
* but to ensure consistency between the TOC and heading numbers we let JS follow
* the TOC if there is one.
*/
.tpl-autonum .mw-parser-output {
counter-reset: autonum-h2 autonum-h3 autonum-h4 autonum-h5 autonum-h6 autonum-h7 autonum-h8 autonum-h9;
}
.tpl-autonum .mw-parser-output .mw-heading2 {
counter-increment: autonum-h2;
counter-reset: autonum-h3 autonum-h4 autonum-h5 autonum-h6 autonum-h7 autonum-h8 autonum-h9;
}
.tpl-autonum .mw-parser-output .mw-heading3 {
counter-increment: autonum-h3;
counter-reset: autonum-h4 autonum-h5 autonum-h6 autonum-h7 autonum-h8 autonum-h9;
}
.tpl-autonum .mw-parser-output .mw-heading4 {
counter-increment: autonum-h4;
counter-reset: autonum-h5 autonum-h6 autonum-h7 autonum-h8 autonum-h9;
}
.tpl-autonum .mw-parser-output .mw-heading5 {
counter-increment: autonum-h5;
counter-reset: autonum-h6 autonum-h7 autonum-h8 autonum-h9;
}
.tpl-autonum .mw-parser-output .mw-heading6 {
counter-increment: autonum-h6;
counter-reset: autonum-h7 autonum-h8 autonum-h9;
}
.tpl-autonum .mw-parser-output .mw-heading7 {
counter-increment: autonum-h7;
counter-reset: autonum-h8 autonum-h9;
}
.tpl-autonum .mw-parser-output .mw-heading8 {
counter-increment: autonum-h8;
counter-reset: autonum-h9;
}
.tpl-autonum .mw-parser-output .mw-heading9 {
counter-reset: autonum-h9;
}
.tpl-autonum .mw-parser-output .mw-heading h2::before {
content: counter(autonum-h2) " ";
}
.tpl-autonum .mw-parser-output .mw-heading h3::before {
content: counter(autonum-h2) "." counter(autonum-h3) " ";
}
.tpl-autonum .mw-parser-output .mw-heading h4::before {
content: counter(autonum-h2) "." counter(autonum-h3) "." counter(autonum-h4) " ";
}
.tpl-autonum .mw-parser-output .mw-heading h5::before {
content: counter(autonum-h2) "." counter(autonum-h3) "." counter(autonum-h4) "." counter(autonum-h5) " ";
}
.tpl-autonum .mw-parser-output .mw-heading h6::before {
content: counter(autonum-h2) "." counter(autonum-h3) "." counter(autonum-h4) "." counter(autonum-h5) "." counter(autonum-h6) " ";
}
.tpl-autonum .mw-parser-output .mw-heading h7::before {
content: counter(autonum-h2) "." counter(autonum-h3) "." counter(autonum-h4) "." counter(autonum-h5) "." counter(autonum-h6) "." counter(autonum-h7) " ";
}
.tpl-autonum .mw-parser-output .mw-heading h8::before {
content: counter(autonum-h2) "." counter(autonum-h3) "." counter(autonum-h4) "." counter(autonum-h5) "." counter(autonum-h6) "." counter(autonum-h7) "." counter(autonum-h8) " ";
}
.tpl-autonum .mw-parser-output .mw-heading h9::before {
content: counter(autonum-h2) "." counter(autonum-h3) "." counter(autonum-h4) "." counter(autonum-h5) "." counter(autonum-h6) "." counter(autonum-h7) "." counter(autonum-h8) "." counter(autonum-h8) " ";
}
/**
* 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 .mw-headline[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 ,
.tpl-autonum-attr .mw-parser-output h7[data-autonum]:before ,
.tpl-autonum-attr .mw-parser-output h8[data-autonum]:before ,
.tpl-autonum-attr .mw-parser-output h9[data-autonum]:before {
content: attr(data-autonum) " ";
}