2023-05-02 18:49:21 +00:00
|
|
|
.vector-toc {
|
2023-05-04 17:23:34 +00:00
|
|
|
.vector-pinnable-header {
|
|
|
|
padding-left: @toc-list-item-padding-start;
|
|
|
|
}
|
|
|
|
|
2023-05-02 18:49:21 +00:00
|
|
|
.vector-toc-numb {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.vector-toc-toggle {
|
|
|
|
// For no-js users, toggling is disabled and icon is hidden
|
|
|
|
display: none;
|
|
|
|
transition: @transition-duration-base;
|
2023-05-03 15:53:54 +00:00
|
|
|
position: absolute;
|
|
|
|
left: -@size-toc-subsection-toggle/2;
|
|
|
|
// Visual centering.
|
2023-04-27 20:39:40 +00:00
|
|
|
top: 1px;
|
|
|
|
// Override .cdx-button styles
|
|
|
|
min-width: @size-toc-subsection-toggle; // ~22px @ 12
|
|
|
|
min-height: @size-toc-subsection-toggle;
|
|
|
|
padding: 0;
|
|
|
|
font-size: @size-toc-subsection-toggle-icon;
|
2023-05-02 18:49:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.vector-toc-link {
|
2023-05-03 15:53:54 +00:00
|
|
|
display: block;
|
2023-05-02 18:49:21 +00:00
|
|
|
word-break: break-word;
|
|
|
|
color: @color-link;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Highlight and bold active sections, active top sections that are unexpanded
|
|
|
|
// and active top sections that are the only active element.
|
|
|
|
.vector-toc-list-item-active,
|
|
|
|
.vector-toc-level-1-active:not( .vector-toc-list-item-expanded ),
|
|
|
|
.vector-toc-list-item-active.vector-toc-level-1-active {
|
|
|
|
> .vector-toc-link {
|
|
|
|
// Highlight active section
|
|
|
|
color: @color-base;
|
|
|
|
font-weight: bold;
|
|
|
|
|
|
|
|
.vector-toc-text {
|
|
|
|
// Increase width to prevent line wrapping due to bold text
|
|
|
|
// Avoid applying on link element to avoid focus indicator changing size
|
2023-05-03 15:53:54 +00:00
|
|
|
width: ~'calc( 100% + @{padding-horizontal-dropdown-menu} )';
|
2023-05-02 18:49:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Highlight active top sections that contain an active section
|
|
|
|
.vector-toc-level-1-active:not( .vector-toc-list-item-active ) > .vector-toc-link {
|
|
|
|
color: @color-base;
|
|
|
|
}
|
|
|
|
|
|
|
|
.vector-toc-text {
|
|
|
|
// Match .mixin-vector-dropdown-menu-item() vertical padding
|
|
|
|
padding: @padding-vertical-dropdown-menu-item 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.vector-toc-contents,
|
|
|
|
.vector-toc-list {
|
|
|
|
margin: 0;
|
|
|
|
list-style: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.vector-toc-list-item {
|
|
|
|
position: relative;
|
|
|
|
list-style-type: none;
|
2023-05-04 17:23:34 +00:00
|
|
|
padding-left: @toc-list-item-padding-start;
|
2023-05-02 18:49:21 +00:00
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Collapse ToC sections by default, excluding no-js
|
|
|
|
&.client-js .vector-toc {
|
|
|
|
.vector-toc-level-1 .vector-toc-list-item {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.vector-toc-level-1.vector-toc-list-item-expanded .vector-toc-list-item {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
|
|
|
.vector-toc-toggle {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
|
|
|
.vector-toc-level-1.vector-toc-list-item-expanded .vector-toc-toggle {
|
|
|
|
transform: rotate( 0deg );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.client-js body.ltr .vector-toc .vector-toc-toggle {
|
|
|
|
transform: rotate( -90deg );
|
|
|
|
}
|
|
|
|
|
|
|
|
&.client-js body.rtl .vector-toc .vector-toc-toggle {
|
|
|
|
transform: rotate( 90deg );
|
|
|
|
}
|
|
|
|
|
|
|
|
// Ensure there is only 1 table of contents landmark at anytime
|
|
|
|
.vector-toc-landmark {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2023-09-18 15:51:28 +00:00
|
|
|
&.vector-feature-toc-pinned-clientpref-0 body:not( .vector-sticky-header-visible ) .vector-page-titlebar,
|
|
|
|
&.vector-feature-toc-pinned-clientpref-0 .vector-sticky-header-visible .vector-sticky-header-context-bar,
|
2023-09-26 19:32:38 +00:00
|
|
|
&.vector-feature-toc-pinned-clientpref-1 .vector-column-start {
|
2023-05-08 23:20:02 +00:00
|
|
|
> .vector-toc-landmark {
|
2023-05-02 18:49:21 +00:00
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// On smaller viewports the TOC will always be moved to the page titlebar via JS
|
|
|
|
// regardless of the TOC pinned classes
|
|
|
|
@media ( max-width: @max-width-tablet ) {
|
|
|
|
&.client-js .vector-page-titlebar .vector-toc-landmark {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.client-js .mw-table-of-contents-container.vector-toc-landmark {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|