2022-12-20 18:09:01 +00:00
|
|
|
@import '../../common/variables.less';
|
2023-02-04 02:01:56 +00:00
|
|
|
@import '../../common/mixins.less';
|
2022-12-20 18:09:01 +00:00
|
|
|
|
|
|
|
.mw-table-of-contents-container {
|
|
|
|
// Needed for Grid-based layout
|
|
|
|
align-self: start;
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
|
2023-01-20 03:21:13 +00:00
|
|
|
@media ( min-width: @min-width-desktop ) {
|
|
|
|
#mw-panel-toc {
|
|
|
|
.vector-toc-pinned & {
|
|
|
|
// Support: Chrome
|
|
|
|
// Work around sticky-positioned layers disabling subpixel text rendering (T327460).
|
|
|
|
// NOTE: This property has an effect similar to 'overflow: hidden', and will prevent elements
|
|
|
|
// inside of the panel from being rendered outside of its bounding box, even when they would
|
|
|
|
// be positioned there using absolute positioning, negative margin, transforms, etc.
|
|
|
|
// That's why the negative margins have to be applied here, instead of on #vector-toc.
|
|
|
|
contain: paint;
|
|
|
|
}
|
|
|
|
|
2022-10-21 18:37:26 +00:00
|
|
|
// FIXME: `.vector-feature-page-tools-disabled.vector-toc-pinned` can be removed when cached HTML no longer an issue.
|
|
|
|
.vector-feature-page-tools-disabled .vector-toc-pinned &,
|
2023-01-20 03:21:13 +00:00
|
|
|
.vector-feature-page-tools-disabled.vector-toc-pinned & {
|
|
|
|
// Align the left edge of the TOC text with the main menu button icon.
|
|
|
|
margin-left: -27px;
|
|
|
|
}
|
|
|
|
|
2022-10-21 18:37:26 +00:00
|
|
|
// FIXME: `.vector-feature-page-tools-enabled.vector-toc-pinned` can be removed when cached HTML no longer an issue.
|
|
|
|
.vector-feature-page-tools-enabled .vector-toc-pinned &,
|
2023-01-20 03:21:13 +00:00
|
|
|
.vector-feature-page-tools-enabled.vector-toc-pinned & {
|
|
|
|
// Align the left edge of the TOC text with the page container
|
|
|
|
margin-left: -@spacing-subsection-toggle;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#vector-toc-pinned-container {
|
|
|
|
// stylelint-disable-next-line plugin/no-unsupported-browser-features
|
|
|
|
position: sticky;
|
2023-02-04 02:01:56 +00:00
|
|
|
// The design spec specifies 30px of space from the top of the viewport to the top of the pinned TOC (excluding top padding).
|
|
|
|
top: @top-sticky-toc;
|
|
|
|
|
|
|
|
.vector-toc {
|
|
|
|
max-height: ~'calc( 100vh - @{top-sticky-toc} - @{max-height-bottom-spacing-scroll-indicator} )';
|
|
|
|
}
|
2022-12-20 18:09:01 +00:00
|
|
|
|
|
|
|
.vector-toc-pinned & {
|
|
|
|
// Default spacing separating the sidebar TOC from the main menu or viewport.
|
2023-02-04 02:01:56 +00:00
|
|
|
margin-top: 1.5em;
|
2022-12-20 18:09:01 +00:00
|
|
|
}
|
|
|
|
|
2022-10-21 18:37:26 +00:00
|
|
|
// FIXME: .vector-feature-page-tools-disabled.vector-toc-pinned can be removed when cached HTML no longer an issue.
|
|
|
|
.vector-feature-page-tools-disabled .vector-toc-pinned @{selector-main-menu-closed} ~ .mw-table-of-contents-container &,
|
2022-12-22 23:10:29 +00:00
|
|
|
.vector-feature-page-tools-disabled.vector-toc-pinned @{selector-main-menu-closed} ~ .mw-table-of-contents-container & {
|
2023-02-04 02:01:56 +00:00
|
|
|
// Needed to align TOC with bottom of title.
|
|
|
|
margin-top: @margin-top-pinned-toc;
|
2022-12-20 18:09:01 +00:00
|
|
|
}
|
|
|
|
|
2022-10-21 18:37:26 +00:00
|
|
|
// FIXME: .vector-feature-page-tools-enabled.vector-toc-pinned can be removed when cached HTML no longer an issue.
|
|
|
|
.vector-feature-page-tools-enabled.vector-feature-main-menu-pinned-disabled .vector-toc-pinned &,
|
2022-12-22 23:10:29 +00:00
|
|
|
.vector-feature-page-tools-enabled.vector-toc-pinned.vector-feature-main-menu-pinned-disabled & {
|
2023-01-06 17:07:29 +00:00
|
|
|
// Align TOC with bottom of title when main menu is not pinned but the TOC is
|
|
|
|
margin-top: @margin-top-pinned-toc;
|
2022-12-22 23:10:29 +00:00
|
|
|
}
|
|
|
|
|
2023-01-09 20:15:42 +00:00
|
|
|
.vector-feature-page-tools-enabled & .vector-toc {
|
2023-01-20 03:21:13 +00:00
|
|
|
padding-left: @spacing-subsection-toggle;
|
2023-01-09 20:15:42 +00:00
|
|
|
padding-right: @padding-horizontal-dropdown-menu-item;
|
|
|
|
// Add extra padding for the fade scrollable indicator, which is 30px tall
|
2023-02-04 02:01:56 +00:00
|
|
|
padding-bottom: @height-scroll-indicator - @padding-vertical-dropdown-menu-item;
|
2023-01-09 20:15:42 +00:00
|
|
|
}
|
|
|
|
|
2022-12-20 18:09:01 +00:00
|
|
|
// T302076: Add fade scrollable indicator when TOC is in sidebar
|
|
|
|
// Avoid showing indicator when the TOC is floating, or collapsed in the page title/sticky header
|
2023-01-13 20:56:22 +00:00
|
|
|
.vector-toc-pinned & .vector-toc:after {
|
2023-02-04 02:01:56 +00:00
|
|
|
.mixin-vector-scroll-indicator();
|
2022-12-20 18:09:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|