2022-06-08 15:03:38 +00:00
|
|
|
@import '../../common/variables.less';
|
2022-09-29 22:54:55 +00:00
|
|
|
@import '../../common/mixins.less';
|
2022-06-08 15:03:38 +00:00
|
|
|
|
2023-01-09 20:15:42 +00:00
|
|
|
@selector-nojs-collapsed-toc-open: ~'#vector-toc-collapsed-checkbox:checked';
|
2022-06-10 17:58:21 +00:00
|
|
|
|
2023-01-09 18:48:02 +00:00
|
|
|
.vector-feature-page-tools-enabled .vector-unpinned-container .vector-toc {
|
|
|
|
// Adjust TOC spacing when unpinned
|
|
|
|
.vector-pinnable-header {
|
|
|
|
padding-left: @padding-horizontal-dropdown-menu-item + @spacing-subsection-toggle;
|
2022-12-22 23:10:29 +00:00
|
|
|
}
|
2022-07-01 20:19:57 +00:00
|
|
|
|
2023-01-09 18:48:02 +00:00
|
|
|
.vector-toc-contents {
|
|
|
|
padding-right: @padding-horizontal-dropdown-menu-item;
|
|
|
|
padding-left: @padding-horizontal-dropdown-menu-item + @spacing-subsection-toggle;
|
2022-10-20 21:32:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-09 18:48:02 +00:00
|
|
|
// TOC dropdown/button styles
|
|
|
|
#vector-toc-collapsed-button,
|
|
|
|
.vector-sticky-header-toc,
|
2022-11-21 22:16:07 +00:00
|
|
|
.vector-page-titlebar-toc {
|
2023-01-09 18:48:02 +00:00
|
|
|
display: none;
|
|
|
|
margin-right: 8px;
|
|
|
|
}
|
2022-09-09 16:22:07 +00:00
|
|
|
|
2023-01-09 18:48:02 +00:00
|
|
|
// TOC styles when unpinned
|
|
|
|
.mixin-toc-unpinned() {
|
|
|
|
display: block;
|
2022-06-08 15:03:38 +00:00
|
|
|
|
2023-01-10 17:28:17 +00:00
|
|
|
> .vector-menu-content {
|
|
|
|
// Override default dropdown max width
|
|
|
|
max-width: none;
|
|
|
|
}
|
|
|
|
|
2023-01-09 18:48:02 +00:00
|
|
|
// Shared unpinned TOC styles, applies across all unpinned cases (page titlebar, sticky header, floating)
|
|
|
|
// FIXME: Remove all .sidebar-toc selectors after I5b9228380f5c4674ef424d33127a5cb4010822da is in prod for 5 days
|
|
|
|
.sidebar-toc,
|
|
|
|
.vector-toc {
|
|
|
|
// T316056 Remove TOC menu fixed width and apply min/max-width
|
|
|
|
width: max-content;
|
|
|
|
min-width: 200px;
|
|
|
|
// Collapsed TOC should be smaller than 85% of the content container (51em) and 75vw
|
|
|
|
max-width: ~'min( 0.85 * @{max-width-content-container}, 75vw )'; // min( 51em, 75vw )
|
2022-06-08 15:03:38 +00:00
|
|
|
}
|
2022-11-21 22:16:07 +00:00
|
|
|
}
|
2022-06-08 15:03:38 +00:00
|
|
|
|
2023-01-09 18:48:02 +00:00
|
|
|
.vector-feature-page-tools-disabled .vector-unpinned-container .vector-toc {
|
|
|
|
box-sizing: content-box;
|
2022-06-08 15:03:38 +00:00
|
|
|
}
|
2022-07-08 16:13:32 +00:00
|
|
|
|
2022-11-21 22:16:07 +00:00
|
|
|
.client-js {
|
|
|
|
@media ( max-width: @max-width-tablet ) {
|
|
|
|
// Prevent layout shift from the TOC being in the sidebar before JS loads and
|
|
|
|
// moves the TOC into the page titlebar on small screens
|
2022-12-20 22:58:44 +00:00
|
|
|
// FIXME: Remove all .sidebar-toc selectors after I5b9228380f5c4674ef424d33127a5cb4010822da is in prod for 5 days
|
|
|
|
#vector-toc-pinned-container .sidebar-toc,
|
|
|
|
#vector-toc-pinned-container .vector-toc {
|
2022-11-21 22:16:07 +00:00
|
|
|
display: none;
|
|
|
|
}
|
2022-07-08 16:13:32 +00:00
|
|
|
|
2022-11-21 22:16:07 +00:00
|
|
|
// Hide pin ToC toggles on smaller resolution
|
2022-12-20 22:58:44 +00:00
|
|
|
// FIXME: Remove all .sidebar-toc selectors after I5b9228380f5c4674ef424d33127a5cb4010822da is in prod for 5 days
|
|
|
|
.sidebar-toc .vector-pinnable-header-toggle-button,
|
|
|
|
.vector-toc .vector-pinnable-header-toggle-button {
|
2022-11-21 22:16:07 +00:00
|
|
|
display: none;
|
|
|
|
}
|
2022-10-28 21:50:42 +00:00
|
|
|
|
2022-11-21 22:16:07 +00:00
|
|
|
//
|
|
|
|
// TOC in page titlebar on narrow screens
|
|
|
|
//
|
2023-01-09 18:48:02 +00:00
|
|
|
.vector-page-titlebar-toc {
|
|
|
|
.mixin-toc-unpinned();
|
|
|
|
}
|
2022-11-21 22:16:07 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// TOC floating on narrow screens when below page title
|
|
|
|
//
|
|
|
|
.vector-below-page-title {
|
|
|
|
.vector-page-titlebar-toc {
|
|
|
|
position: fixed;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
margin: 0;
|
2023-01-09 18:48:02 +00:00
|
|
|
// Override background color for when the TOC button overlaps content
|
|
|
|
// as a fixed element when the page is scrolled down.
|
|
|
|
background-color: @background-color-base;
|
|
|
|
z-index: @z-index-menu;
|
2022-07-08 16:13:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-09-09 16:22:07 +00:00
|
|
|
|
2022-11-21 22:16:07 +00:00
|
|
|
@media ( min-width: @min-width-desktop ) {
|
|
|
|
//
|
|
|
|
// TOC in page titlebar
|
|
|
|
//
|
|
|
|
.vector-toc-unpinned:not( .vector-sticky-header-visible ) {
|
2023-01-09 18:48:02 +00:00
|
|
|
.vector-page-titlebar-toc {
|
|
|
|
.mixin-toc-unpinned();
|
|
|
|
}
|
2022-11-21 22:16:07 +00:00
|
|
|
}
|
2022-09-29 22:54:55 +00:00
|
|
|
|
2022-11-21 22:16:07 +00:00
|
|
|
//
|
|
|
|
// TOC in sticky header
|
|
|
|
//
|
2023-01-09 18:48:02 +00:00
|
|
|
.vector-toc-unpinned.vector-sticky-header-visible {
|
|
|
|
.vector-sticky-header-toc {
|
|
|
|
.mixin-toc-unpinned();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// No-js TOC
|
|
|
|
//
|
|
|
|
@media ( max-width: @max-width-tablet ) {
|
|
|
|
.client-nojs {
|
|
|
|
#vector-toc-collapsed-button {
|
|
|
|
display: block;
|
|
|
|
// Override the default button styles so the ToC button is slightly shorter when collapsed into the page title
|
|
|
|
padding: 7px 12px;
|
|
|
|
|
|
|
|
&:hover,
|
|
|
|
&:active {
|
|
|
|
background-color: @colorGray15;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#vector-toc-pinned-container {
|
|
|
|
// Override TOC container's sticky positioning
|
|
|
|
position: relative;
|
|
|
|
.mixin-toc-unpinned();
|
|
|
|
}
|
|
|
|
|
2022-12-20 22:58:44 +00:00
|
|
|
// FIXME: Remove all .sidebar-toc selectors after I5b9228380f5c4674ef424d33127a5cb4010822da is in prod for 5 days
|
2023-01-09 18:48:02 +00:00
|
|
|
.sidebar-toc,
|
|
|
|
.vector-toc {
|
|
|
|
display: none;
|
|
|
|
position: absolute;
|
|
|
|
top: 36px; // TOC button height
|
|
|
|
// FIXME: Don't use a magic number. This used to be tied to the private variable in core
|
|
|
|
// @icon-padding-md so perhaps this needs to make use of the flush classes?
|
|
|
|
left: -12px;
|
|
|
|
margin-top: @padding-top-content; // Account for padding-top from .mw-body
|
|
|
|
// FIXME: Collapsed TOC styles are not consistent with other vector dropdowns
|
|
|
|
border: @border-width-base @border-style-base @border-color-base;
|
|
|
|
z-index: @z-index-menu;
|
|
|
|
}
|
|
|
|
|
2023-01-10 17:28:17 +00:00
|
|
|
.vector-feature-page-tools-enabled .vector-toc {
|
|
|
|
padding-left: @padding-horizontal-dropdown-menu-item;
|
|
|
|
}
|
|
|
|
|
2023-01-09 18:48:02 +00:00
|
|
|
// FIXME: Remove all .sidebar-toc selectors after I5b9228380f5c4674ef424d33127a5cb4010822da is in prod for 5 days
|
|
|
|
@{selector-nojs-collapsed-toc-open} ~ .mw-table-of-contents-container .sidebar-toc,
|
|
|
|
@{selector-nojs-collapsed-toc-open} ~ .mw-table-of-contents-container .vector-toc {
|
|
|
|
// Hide the TOC when the button is not checked
|
|
|
|
display: block;
|
2022-11-21 22:16:07 +00:00
|
|
|
}
|
|
|
|
}
|
2022-09-09 16:22:07 +00:00
|
|
|
}
|