2022-01-11 19:52:26 +00:00
|
|
|
@import '../../common/variables.less';
|
|
|
|
|
2023-04-04 03:31:26 +00:00
|
|
|
/**
|
|
|
|
* Checkbox hack used by collapsed TOC on narrow viewports for no JS users.
|
|
|
|
* Although it's display:none, the :checked state is still affected when clicking
|
|
|
|
* the associated label.
|
|
|
|
*/
|
|
|
|
#vector-toc-collapsed-checkbox {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2022-12-20 22:58:44 +00:00
|
|
|
.vector-toc {
|
2022-03-17 18:35:43 +00:00
|
|
|
max-height: 75vh;
|
2022-05-12 20:17:03 +00:00
|
|
|
box-sizing: border-box;
|
2022-09-09 16:22:07 +00:00
|
|
|
overflow-y: auto;
|
|
|
|
overflow-x: hidden;
|
2022-07-20 01:18:07 +00:00
|
|
|
background-color: @background-color-page-container;
|
2023-04-20 05:34:45 +00:00
|
|
|
font-size: @font-size-base;
|
2022-01-11 19:52:26 +00:00
|
|
|
|
2022-11-14 18:24:43 +00:00
|
|
|
.vector-pinnable-header-label {
|
|
|
|
// Override heading element styles in elements.less
|
|
|
|
overflow: unset;
|
|
|
|
}
|
|
|
|
|
2022-12-20 22:58:44 +00:00
|
|
|
.vector-toc-numb {
|
2022-01-11 19:52:26 +00:00
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2022-12-20 22:58:44 +00:00
|
|
|
.vector-toc-toggle {
|
2022-07-08 17:51:28 +00:00
|
|
|
// For no-js users, toggling is disabled and icon is hidden
|
|
|
|
display: none;
|
|
|
|
position: absolute;
|
|
|
|
top: 1px; // visually center icon
|
2022-12-20 22:58:44 +00:00
|
|
|
left: ~'calc( -1 * @{size-toc-subsection-toggle-icon} - 1px )'; // leaves 6px between icon + text
|
2022-07-08 17:51:28 +00:00
|
|
|
font-size: 0.75em; // reduces size of toggle icon to 12px @ 16
|
|
|
|
transition: @transition-duration-base;
|
2022-09-20 21:32:53 +00:00
|
|
|
color: transparent;
|
2022-07-08 17:51:28 +00:00
|
|
|
cursor: pointer;
|
2023-03-28 15:26:22 +00:00
|
|
|
// Vertically center the icon with the text
|
|
|
|
margin-top: 2px;
|
2023-04-27 20:39:40 +00:00
|
|
|
// Reset <button> default browser styles
|
|
|
|
border: 0;
|
|
|
|
background: none;
|
|
|
|
// Override .cdx-button styles
|
|
|
|
min-width: @spacing-subsection-toggle;
|
|
|
|
min-height: @spacing-subsection-toggle;
|
|
|
|
padding: 0;
|
2022-07-08 17:51:28 +00:00
|
|
|
}
|
|
|
|
|
2022-12-20 22:58:44 +00:00
|
|
|
.vector-toc-link {
|
2022-05-02 18:33:59 +00:00
|
|
|
word-break: break-word;
|
2022-04-28 18:07:34 +00:00
|
|
|
color: @color-link;
|
2022-07-18 15:28:09 +00:00
|
|
|
display: block;
|
2022-04-28 18:07:34 +00:00
|
|
|
}
|
|
|
|
|
2022-09-20 21:32:53 +00:00
|
|
|
// Highlight and bold active sections, active top sections that are unexpanded
|
|
|
|
// and active top sections that are the only active element.
|
2022-12-20 22:58:44 +00:00
|
|
|
.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 {
|
2022-09-20 21:32:53 +00:00
|
|
|
// Highlight active section
|
|
|
|
color: @color-base;
|
|
|
|
font-weight: bold;
|
|
|
|
|
2022-12-20 22:58:44 +00:00
|
|
|
.vector-toc-text {
|
2022-09-20 21:32:53 +00:00
|
|
|
// Increase width to prevent line wrapping due to bold text
|
|
|
|
// Avoid applying on link element to avoid focus indicator changing size
|
2023-01-09 20:15:42 +00:00
|
|
|
width: ~'calc( 100% + @{padding-horizontal-dropdown-menu-item} )';
|
2022-09-20 21:32:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Highlight active top sections that contain an active section
|
2022-12-20 22:58:44 +00:00
|
|
|
.vector-toc-level-1-active:not( .vector-toc-list-item-active ) > .vector-toc-link {
|
2022-07-08 17:51:28 +00:00
|
|
|
color: @color-base;
|
|
|
|
}
|
|
|
|
|
2022-12-20 22:58:44 +00:00
|
|
|
.vector-toc-text {
|
2023-03-28 15:26:22 +00:00
|
|
|
// Match .mixin-vector-dropdown-menu-item() vertical padding
|
|
|
|
padding: @padding-vertical-dropdown-menu-item 0;
|
2022-01-11 19:52:26 +00:00
|
|
|
}
|
|
|
|
|
2022-12-20 22:58:44 +00:00
|
|
|
.vector-toc-contents,
|
|
|
|
.vector-toc-list {
|
2022-01-11 19:52:26 +00:00
|
|
|
margin: 0;
|
|
|
|
list-style: none;
|
2022-02-07 19:20:17 +00:00
|
|
|
}
|
2022-01-11 19:52:26 +00:00
|
|
|
|
2022-12-20 22:58:44 +00:00
|
|
|
.vector-toc-list-item {
|
2022-02-07 19:20:17 +00:00
|
|
|
display: block;
|
|
|
|
position: relative;
|
|
|
|
list-style-type: none;
|
2022-04-28 18:21:52 +00:00
|
|
|
padding-left: 8px;
|
2023-03-28 15:26:22 +00:00
|
|
|
margin: 0;
|
2022-12-22 23:10:29 +00:00
|
|
|
|
2022-12-20 22:58:44 +00:00
|
|
|
&.vector-toc-level-1 {
|
2022-07-08 17:51:28 +00:00
|
|
|
padding-left: 0;
|
|
|
|
}
|
|
|
|
|
2022-02-07 19:20:17 +00:00
|
|
|
a {
|
2023-04-20 05:34:45 +00:00
|
|
|
font-size: inherit;
|
2022-02-07 19:20:17 +00:00
|
|
|
}
|
|
|
|
}
|
2022-01-11 19:52:26 +00:00
|
|
|
}
|
|
|
|
|
2022-04-21 16:51:47 +00:00
|
|
|
// Collapse ToC sections by default, excluding no-js
|
2023-05-02 18:49:21 +00:00
|
|
|
&.client-js .vector-toc {
|
2022-12-20 22:58:44 +00:00
|
|
|
.vector-toc-level-1 .vector-toc-list-item {
|
2022-04-21 16:51:47 +00:00
|
|
|
display: none;
|
|
|
|
}
|
2022-02-07 19:20:17 +00:00
|
|
|
|
2022-12-20 22:58:44 +00:00
|
|
|
.vector-toc-level-1.vector-toc-list-item-expanded .vector-toc-list-item {
|
2022-04-21 16:51:47 +00:00
|
|
|
display: block;
|
|
|
|
}
|
2022-02-07 19:20:17 +00:00
|
|
|
|
2022-12-20 22:58:44 +00:00
|
|
|
.vector-toc-toggle {
|
2022-04-21 16:51:47 +00:00
|
|
|
display: block;
|
|
|
|
}
|
2022-02-07 19:20:17 +00:00
|
|
|
|
2022-12-20 22:58:44 +00:00
|
|
|
.vector-toc-level-1.vector-toc-list-item-expanded .vector-toc-toggle {
|
2022-04-21 16:51:47 +00:00
|
|
|
transform: rotate( 0deg );
|
2022-02-07 19:20:17 +00:00
|
|
|
}
|
|
|
|
}
|
2022-03-17 22:58:44 +00:00
|
|
|
|
2023-05-02 18:49:21 +00:00
|
|
|
&.client-js body.ltr .vector-toc .vector-toc-toggle {
|
2022-05-29 19:43:20 +00:00
|
|
|
transform: rotate( -90deg );
|
|
|
|
}
|
|
|
|
|
2023-05-02 18:49:21 +00:00
|
|
|
&.client-js body.rtl .vector-toc .vector-toc-toggle {
|
2022-05-29 19:43:20 +00:00
|
|
|
transform: rotate( 90deg );
|
|
|
|
}
|
2023-02-21 21:19:52 +00:00
|
|
|
|
|
|
|
// Ensure there is only 1 table of contents landmark at anytime
|
|
|
|
.vector-toc-landmark {
|
|
|
|
display: none;
|
2023-05-02 18:49:21 +00:00
|
|
|
}
|
2023-02-21 21:19:52 +00:00
|
|
|
|
2023-05-02 18:49:21 +00:00
|
|
|
&.vector-feature-toc-pinned-disabled body:not( .vector-sticky-header-visible ) .vector-page-titlebar,
|
2023-05-08 23:20:02 +00:00
|
|
|
&.vector-feature-toc-pinned-disabled .vector-sticky-header-visible .vector-sticky-header-context-bar,
|
2023-05-02 18:49:21 +00:00
|
|
|
&.vector-feature-toc-pinned-enabled .mw-page-container-inner {
|
2023-05-08 23:20:02 +00:00
|
|
|
> .vector-toc-landmark {
|
2023-03-13 19:24:14 +00:00
|
|
|
display: block;
|
2023-02-21 21:19:52 +00:00
|
|
|
}
|
2023-05-02 18:49:21 +00:00
|
|
|
}
|
2023-02-21 21:19:52 +00:00
|
|
|
|
2023-05-02 18:49:21 +00:00
|
|
|
// 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;
|
|
|
|
}
|
2023-02-21 21:19:52 +00:00
|
|
|
|
2023-05-02 18:49:21 +00:00
|
|
|
&.client-js .mw-table-of-contents-container.vector-toc-landmark {
|
|
|
|
display: none;
|
2023-02-21 21:19:52 +00:00
|
|
|
}
|
|
|
|
}
|