mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-12-02 03:07:13 +00:00
d4903b8e57
Follow up to I3484a790ce8ebadf21054ac1d222d5632b2dc5a4 __Template__ The template is not particularly useful - it is only ever used once in this context and features a static ID which means it can never be reused. It is also tied to the #vector-toc-collapsed-checkbox element. In current form it doesn't make sense to have this template. Maybe in future, I could see an argument for a PinnableTableOfContents component that wrapped the checkbox and nav element, and generalized the IDs but currently there's no pressing need or value for that. __Layouts__ The existing Pinned and Unpinned stylesheets are concerned with how the table of contents is layed out holistically with regards to other components and features enabled on the page. I think these should therefore be organized as such. The way I reason with this, is these styles would be irrelevant in a component library if the component was rendered in isolation. Bug: T328719 Change-Id: I9ff0e0eeb35f215a8cae5950d08dc1277b662a71
84 lines
3.5 KiB
Plaintext
84 lines
3.5 KiB
Plaintext
@import '../../../common/variables.less';
|
|
@import '../../../common/mixins.less';
|
|
|
|
.mw-table-of-contents-container {
|
|
// Needed for Grid-based layout
|
|
align-self: start;
|
|
height: 100%;
|
|
}
|
|
|
|
@media ( min-width: @min-width-desktop ) {
|
|
#mw-panel-toc {
|
|
// FIXME: Remove the following line containing '.vector-toc-pinned' after line 14 has been in prod for a week.
|
|
.vector-toc-pinned &,
|
|
.vector-feature-toc-pinned-enabled & {
|
|
// 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;
|
|
}
|
|
|
|
// FIXME: Remove the following line containing '.vector-toc-pinned' after line 26 has been in prod for a week.
|
|
.vector-feature-page-tools-disabled .vector-toc-pinned &,
|
|
.vector-feature-page-tools-disabled.vector-feature-toc-pinned-enabled & {
|
|
// Align the left edge of the TOC text with the main menu button icon.
|
|
margin-left: -27px;
|
|
}
|
|
|
|
// FIXME: Remove the following line containing '.vector-toc-pinned' after line 33 has been in prod for a week.
|
|
.vector-feature-page-tools-enabled .vector-toc-pinned &,
|
|
.vector-feature-page-tools-enabled.vector-feature-toc-pinned-enabled & {
|
|
// 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;
|
|
top: 0;
|
|
|
|
// FIXME: Remove the following line containing '.vector-toc-pinned &' after line 46 has been in prod for a week.
|
|
.vector-toc-pinned &,
|
|
.vector-feature-toc-pinned-enabled & {
|
|
// Default spacing separating the sidebar TOC from the main menu.
|
|
margin-top: 1.5em;
|
|
}
|
|
|
|
// FIXME: Remove the following line containing '.vector-toc-pinned' after line 53 has been in prod for a week.
|
|
.vector-feature-page-tools-disabled .vector-toc-pinned @{selector-main-menu-closed} ~ .mw-table-of-contents-container &,
|
|
.vector-feature-page-tools-disabled.vector-feature-toc-pinned-enabled @{selector-main-menu-closed} ~ .mw-table-of-contents-container & {
|
|
// Needed to align TOC with bottom of title.
|
|
margin-top: @margin-top-pinned-toc;
|
|
}
|
|
|
|
// FIXME: Remove the following line containing '.vector-toc-pinned' after line 60 has been in prod for a week.
|
|
.vector-feature-page-tools-enabled.vector-feature-main-menu-pinned-disabled .vector-toc-pinned &,
|
|
.vector-feature-page-tools-enabled.vector-feature-main-menu-pinned-disabled.vector-feature-toc-pinned-enabled & {
|
|
// Align TOC with bottom of title when main menu is not pinned but the TOC is
|
|
margin-top: @margin-top-pinned-toc;
|
|
}
|
|
|
|
// 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
|
|
.vector-toc {
|
|
max-height: ~'calc( 100vh - @{max-height-bottom-spacing-scroll-indicator} )';
|
|
|
|
.mixin-vector-scroll-indicator();
|
|
}
|
|
|
|
.vector-feature-page-tools-disabled & .vector-toc {
|
|
padding-top: ~'calc( @{padding-top-pinned-element} + @{padding-top-tabs} )';
|
|
}
|
|
|
|
.vector-feature-page-tools-enabled & .vector-toc {
|
|
padding-top: @padding-top-pinned-element;
|
|
padding-left: @spacing-subsection-toggle;
|
|
padding-right: @padding-horizontal-dropdown-menu-item;
|
|
}
|
|
}
|
|
}
|