mediawiki-skins-Vector/resources/skins.vector.styles/components/TableOfContentsCollapsed.less
Clare Ming 536e53af7a Minor adjustments to collapsible TOC
Bug: T307900
Change-Id: Iec0c5c6e3dbede85e549fc9558b9d5c7be4fa10d
2022-06-15 09:56:27 -05:00

73 lines
1.8 KiB
Plaintext

@import '../../common/variables.less';
#vector-toc-collapsed-button {
display: none;
}
@media ( max-width: @width-breakpoint-desktop ) {
#vector-toc-collapsed-button,
.sidebar-toc {
z-index: @z-index-menu;
}
#vector-toc-collapsed-button {
// Temporary !important needed while style attribute is present in HTML.
// This is because new HTML can be loaded with old CSS.
/* stylelint-disable-next-line declaration-no-important */
display: block !important;
float: left;
margin-right: 4px;
margin-left: -10px;
// Reduce padding to fit with page title
padding: 7px 10px 7px 10px;
// Override background color for when the TOC is overlaps content
// as a sticky element when the page is scrolled down.
background-color: @background-color-base;
&:hover,
&:active {
background-color: @colorGray15;
}
}
.mw-table-of-contents-container {
top: 0;
}
.sidebar-toc {
position: absolute;
top: 44px;
left: -2px;
// !important needed to override rules in Sidebar.less
/* stylelint-disable-next-line declaration-no-important */
margin-top: 0 !important;
// Dropdown styles
background-color: @color-base--inverted;
border: @border-width-base @border-style-base @border-color-base;
// Remove TOC fade
&:after {
display: none;
}
}
#vector-toc-collapsed-checkbox:checked ~ .mw-table-of-contents-container {
position: relative;
clear: none;
.sidebar-toc {
display: block;
}
}
}
@media ( min-width: @width-breakpoint-tablet ) and ( max-width: @width-breakpoint-desktop ) {
body:not( .vector-below-page-title ) @{selector-checkbox-hack} .sidebar-toc {
// Adjust TOC for when the page title is farther right on the screen
// i.e. when the main menu is open and the viewport is between tablet and desktop
left: 22px;
}
}