mediawiki-skins-Vector/resources/skins.vector.styles/components/PageTools.less
Nicholas Ray ffda1975e3 Make page tools sticky
* Adds sticky behavior to pinned page tools

* Moves scroll indicator styles into a mixin shared by TOC and page tools

* Replaces the 10px magic number in the TOC used to calculate the bottom padding with the
@padding-vertical-dropdown-menu variable.

* Increases the pinned TOC max-height per T319315

* Corrects spacing between bottom of sticky header and top of TOC after discussion with designer

* Causes 43 visual changes in Pixel that include intentional changes and subpixel
rendering changes associated with the `contain: paint` rule.

Bug: T318169
Bug: T319315
Change-Id: Ica0c4e0de1825d37d8136b589a9bf5decc96855e
2023-02-07 12:49:48 -07:00

60 lines
1.7 KiB
Plaintext

@import '../../common/variables.less';
@import '../../common/mixins.less';
// Ensure there is only 1 page tools landmark at anytime
.vector-page-tools-landmark {
.vector-feature-page-tools-pinned-enabled .vector-page-toolbar-container &,
.vector-feature-page-tools-pinned-disabled .vector-column-end & {
display: none;
}
}
.vector-column-end {
// T327460: Prevent subpixel rendering issues associated with the text and Chrome.
contain: paint;
.vector-page-tools-landmark {
// stylelint-disable-next-line plugin/no-unsupported-browser-features
position: sticky;
top: 0;
}
}
.vector-page-tools {
#vector-page-tools-pinned-container & {
width: 140px;
// Match spacing of TOC and main menu
margin-left: @padding-horizontal-dropdown-menu-item;
max-height: ~'calc( 100vh - @{max-height-bottom-spacing-scroll-indicator} )';
overflow-y: auto;
// Add extra padding for the fade scrollable indicator.
padding-bottom: @height-scroll-indicator - @padding-vertical-dropdown-menu-item;
box-sizing: border-box;
// Add fade indicator.
&:after {
.mixin-vector-scroll-indicator();
}
}
}
// FIXME: Remove the following selector when page tools feature is on by default, needed for LegacyMoreDropdown
.vector-feature-page-tools-disabled .vector-page-tools-landmark,
.vector-page-tools {
// Ensure collapsible items are visible on lower resolutions
.vector-more-collapsible-item {
display: block;
@media ( min-width: @min-width-tablet ) {
display: none;
}
}
// Make sure pcactions is displayed on lower resolutions (even if .emptyPortlet present)
.vector-has-collapsible-items {
@media ( max-width: @max-width-mobile ) {
display: block;
}
}
}