4 * Default styles for the display of table of contents in @media screen.
6 * Styles for @media print are inside print.css.
9 @import 'mediawiki.mixins.less';
10 @import 'mediawiki.skin.variables.less';
12 /* stylelint-disable selector-class-pattern */
14 /* Table of Contents */
17 background-color: @background-color-neutral-subtle;
18 border: @border-width-base @border-style-base @border-color-base;
24 * We want to display the ToC element with intrinsic width in block mode. The fit-content
25 * value for width is however not supported by large groups of browsers.
27 * We use display:table. Even though it should only contain other table-* display
28 * elements, there are no known problems with using this.
55 .margin-inline( 2em, 0 );
60 /* CSS for backwards-compatibility with cached page renders and creative uses in wikitext */
62 border-collapse: collapse;
64 /* Remove additional paddings inside table-cells that are not present in <div>s */
70 /* Separate columns for tocnumber and toctext */
75 * Text decorations are not propagated to the contents of inline blocks and inline tables,
76 * according to <https://www.w3.org/TR/css-text-decor-3/#line-decoration>, and 'display: table-cell'
77 * generates an inline table when used without any parent table-rows and tables.
79 text-decoration: inherit;
86 /* Overwrite the style="display:none" and make the checkbox invisible on another way to */
87 /* allow to focus the checkbox with keyboard. */
89 // Make the checkbox visible to allow it to focus with keyboard.
90 display: inline !important; /* stylelint-disable-line declaration-no-important */
91 // Remove any size of the checkbox.
93 // Make the checkbox invisible.
95 // Prevent that the checkbox is clickable and changes the cursor.
103 .toctogglespan::before {
107 .toctogglespan::after {
111 /* Make the label look like a link. */
117 .toctogglelabel:hover {
118 text-decoration: underline;
121 /* Show a focus ring around the label when focusing the invisible checkbox. */
122 /* This simulates that the label is in focus. */
123 .toctogglecheckbox:focus + .toctitle .toctogglelabel {
124 text-decoration: underline;
128 /* Change the text of the button based on the state of the checkbox. */
129 .toctogglecheckbox:checked + .toctitle .toctogglelabel::after {
130 content: '@{msg-showtoc}';
133 .toctogglecheckbox:not( :checked ) + .toctitle .toctogglelabel::after {
134 content: '@{msg-hidetoc}';