2021-04-29 01:01:54 +00:00
|
|
|
@import '../../../minerva.less/minerva.variables.less';
|
2019-08-30 00:02:35 +00:00
|
|
|
|
2021-10-02 14:40:27 +00:00
|
|
|
@toc-large-icon: 44px;
|
|
|
|
@toc-small-icon: 34px;
|
|
|
|
|
2019-11-25 17:00:48 +00:00
|
|
|
.toc {
|
2019-08-30 00:02:35 +00:00
|
|
|
display: none;
|
|
|
|
position: relative;
|
|
|
|
margin: 1em 0;
|
2021-10-02 14:40:27 +00:00
|
|
|
padding: 0 1em 1em 1em;
|
2019-08-30 00:02:35 +00:00
|
|
|
background-color: @colorGray15;
|
|
|
|
border: solid 1px @grayLightest;
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
2021-10-02 14:40:27 +00:00
|
|
|
// We need high specificity to override .content ul
|
|
|
|
&.toc > ul {
|
|
|
|
// Account for the icon spaces left and right.
|
|
|
|
// margin: 0 @toc-small-icon 0 @toc-large-icon;
|
|
|
|
font-size: @font-size-minerva-small;
|
|
|
|
// Reset `.client-js .toc > ul`.
|
|
|
|
padding-left: 0;
|
|
|
|
}
|
2019-08-30 00:02:35 +00:00
|
|
|
|
2021-10-02 14:40:27 +00:00
|
|
|
// We need high specificity to override .content ul
|
|
|
|
&.toc ul {
|
|
|
|
list-style: none;
|
|
|
|
// break long headings like urls
|
|
|
|
word-break: break-word;
|
|
|
|
}
|
2020-11-25 20:01:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.toctitle {
|
2021-10-02 14:40:27 +00:00
|
|
|
@toctitle-vertical-padding: 1.4em / 2;
|
|
|
|
font-weight: bold;
|
|
|
|
display: flex;
|
|
|
|
// Force vertical centering on title by making this full height
|
|
|
|
align-items: center;
|
|
|
|
// Ensure height for icon
|
|
|
|
min-height: @toc-large-icon;
|
2020-11-25 20:01:08 +00:00
|
|
|
|
2021-10-02 14:40:27 +00:00
|
|
|
// We need high specificity to override .content h2
|
|
|
|
&.toctitle h2 {
|
|
|
|
display: inline-block;
|
|
|
|
font-family: @font-family-base;
|
|
|
|
font-size: unit( 18/16, em );
|
|
|
|
vertical-align: middle;
|
2020-11-25 20:01:08 +00:00
|
|
|
}
|
2021-10-02 14:40:27 +00:00
|
|
|
}
|
2020-11-25 20:01:08 +00:00
|
|
|
|
2021-10-02 14:40:27 +00:00
|
|
|
.tocnumber {
|
|
|
|
display: none;
|
2019-08-30 00:02:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.toctogglelabel {
|
|
|
|
position: absolute;
|
|
|
|
left: 0;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
2021-10-02 14:40:27 +00:00
|
|
|
height: @toc-large-icon;
|
2019-08-30 00:02:35 +00:00
|
|
|
z-index: @z-indexAboveContent;
|
|
|
|
}
|
|
|
|
|
2021-10-02 14:40:27 +00:00
|
|
|
// Do stuff we only need to do with JS
|
|
|
|
// Collapsing and reserving space for the JS icons
|
2019-11-25 17:00:48 +00:00
|
|
|
.client-js .toc {
|
2021-10-02 14:40:27 +00:00
|
|
|
// Reset padding, because we need to reserve space for icons
|
|
|
|
padding: 0;
|
|
|
|
|
2019-08-30 00:02:35 +00:00
|
|
|
.toctitle {
|
2021-10-02 14:40:27 +00:00
|
|
|
// Reserve space for icons
|
|
|
|
padding: 0 @toc-small-icon 0 @toc-large-icon;
|
|
|
|
|
|
|
|
.mw-ui-icon {
|
|
|
|
position: absolute;
|
|
|
|
left: 0;
|
2019-08-30 00:02:35 +00:00
|
|
|
}
|
|
|
|
|
2021-10-02 14:40:27 +00:00
|
|
|
.toctogglespan + .mw-ui-icon {
|
|
|
|
top: (@toc-large-icon - @toc-small-icon) / 2;
|
|
|
|
right: 0;
|
|
|
|
left: auto;
|
|
|
|
}
|
2019-08-30 00:02:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
> ul {
|
2020-11-25 20:01:08 +00:00
|
|
|
// Account for the icon spaces left and right.
|
2021-10-02 14:40:27 +00:00
|
|
|
margin: 0 @toc-small-icon 0 @toc-large-icon;
|
2019-08-30 00:02:35 +00:00
|
|
|
}
|
|
|
|
|
2021-10-02 14:40:27 +00:00
|
|
|
.toctogglecheckbox ~ ul {
|
|
|
|
visibility: hidden;
|
|
|
|
height: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.toctogglecheckbox:checked ~ ul {
|
|
|
|
visibility: visible;
|
|
|
|
padding-bottom: 20px;
|
|
|
|
height: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.toctogglelabel {
|
|
|
|
cursor: pointer;
|
2019-08-30 00:02:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@media screen and ( min-width: @width-breakpoint-tablet ) {
|
2021-10-02 14:40:27 +00:00
|
|
|
.toc {
|
|
|
|
// Reset the rule for mobile mode
|
2019-08-30 00:02:35 +00:00
|
|
|
display: table;
|
|
|
|
|
|
|
|
.toctitle {
|
|
|
|
visibility: visible;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|