2022-06-08 15:03:38 +00:00
|
|
|
@import '../../common/variables.less';
|
|
|
|
|
2022-07-01 20:19:57 +00:00
|
|
|
@height-collapsed-toc-button: 36px;
|
|
|
|
@padding-top-content-px: unit( @padding-top-content * @font-size-browser, px );
|
|
|
|
@selector-collapsed-toc-open: ~'#vector-toc-collapsed-checkbox:checked';
|
2022-06-10 17:58:21 +00:00
|
|
|
|
2022-06-08 15:03:38 +00:00
|
|
|
#vector-toc-collapsed-button {
|
|
|
|
display: none;
|
2022-07-08 16:13:32 +00:00
|
|
|
float: left;
|
|
|
|
margin-right: 4px;
|
|
|
|
margin-left: -@icon-padding-md;
|
|
|
|
// 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;
|
2022-06-08 15:03:38 +00:00
|
|
|
|
2022-07-08 16:13:32 +00:00
|
|
|
&:hover,
|
|
|
|
&:active {
|
|
|
|
background-color: @colorGray15;
|
2022-06-08 15:03:38 +00:00
|
|
|
}
|
2022-07-08 16:13:32 +00:00
|
|
|
}
|
2022-06-08 15:03:38 +00:00
|
|
|
|
2022-07-08 16:13:32 +00:00
|
|
|
#vector-toc-collapsed-button,
|
|
|
|
.sidebar-toc {
|
|
|
|
z-index: @z-index-menu;
|
|
|
|
}
|
|
|
|
|
2022-08-15 16:34:28 +00:00
|
|
|
.ve-active {
|
|
|
|
#vector-toc-collapsed-button {
|
|
|
|
display: none !important; /* stylelint-disable-line declaration-no-important */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-01 20:19:57 +00:00
|
|
|
// Override button styles for the "move to sidebar/hide" links. Default hide.
|
|
|
|
.vector-toc-collapse-button,
|
|
|
|
.vector-toc-uncollapse-button {
|
|
|
|
display: none;
|
|
|
|
border: 0;
|
|
|
|
padding: 0;
|
|
|
|
background-color: transparent;
|
|
|
|
color: @color-primary;
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
color: @color-primary--hover;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:before {
|
|
|
|
content: '@{msg-brackets-start}';
|
|
|
|
color: @color-base--subtle;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:after {
|
|
|
|
content: '@{msg-brackets-end}';
|
|
|
|
color: @color-base--subtle;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Applies when TOC is collapsed in it's original DOM location
|
|
|
|
// Doesn't apply to the collapsed TOC in the sticky header
|
|
|
|
.mixin-toc-collapsed-unmoved() {
|
2022-06-08 15:03:38 +00:00
|
|
|
#vector-toc-collapsed-button {
|
2022-06-10 21:14:39 +00:00
|
|
|
display: block;
|
2022-06-08 15:03:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.mw-table-of-contents-container {
|
2022-06-10 17:58:21 +00:00
|
|
|
position: relative;
|
2022-06-08 15:03:38 +00:00
|
|
|
}
|
|
|
|
|
2022-07-01 20:19:57 +00:00
|
|
|
@{sidebar-toc-selector} {
|
|
|
|
display: none;
|
2022-06-08 15:03:38 +00:00
|
|
|
position: absolute;
|
2022-07-01 20:19:57 +00:00
|
|
|
margin: 0;
|
|
|
|
// FIXME: Collapsed TOC styles are not consistent with other vector dropdowns
|
2022-06-08 15:03:38 +00:00
|
|
|
border: @border-width-base @border-style-base @border-color-base;
|
|
|
|
}
|
|
|
|
|
2022-07-01 20:19:57 +00:00
|
|
|
@{selector-collapsed-toc-open} ~ @{sidebar-toc-selector} {
|
2022-07-08 17:51:28 +00:00
|
|
|
// Hide the TOC when the button is not checked
|
2022-07-01 20:19:57 +00:00
|
|
|
display: block;
|
2022-06-10 17:58:21 +00:00
|
|
|
}
|
2022-07-08 16:13:32 +00:00
|
|
|
}
|
|
|
|
|
2022-07-01 20:19:57 +00:00
|
|
|
.mixin-toc-collapsed-floating() {
|
|
|
|
#vector-toc-collapsed-button,
|
|
|
|
.sidebar-toc {
|
|
|
|
position: fixed;
|
2022-07-26 20:57:51 +00:00
|
|
|
}
|
|
|
|
|
2022-07-01 20:19:57 +00:00
|
|
|
#vector-toc-collapsed-button {
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
margin: 0;
|
2022-07-26 20:57:51 +00:00
|
|
|
}
|
|
|
|
|
2022-07-01 20:19:57 +00:00
|
|
|
.sidebar-toc {
|
|
|
|
top: @height-collapsed-toc-button; // TOC button height
|
|
|
|
left: 6px;
|
2022-07-26 20:57:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-08 16:13:32 +00:00
|
|
|
@media ( max-width: @max-width-tablet ) {
|
2022-07-01 20:19:57 +00:00
|
|
|
// Collapsed to page title on narrow screens
|
|
|
|
.mixin-toc-collapsed-unmoved();
|
2022-06-08 15:03:38 +00:00
|
|
|
|
2022-07-01 20:19:57 +00:00
|
|
|
@{sidebar-toc-selector} {
|
|
|
|
top: ~'calc(@{height-collapsed-toc-button} + @{padding-top-content-px})'; // 44px
|
|
|
|
left: -4px;
|
|
|
|
}
|
2022-06-10 17:58:21 +00:00
|
|
|
|
2022-07-01 20:19:57 +00:00
|
|
|
// Collapsed to floating icon on narrow screens when below page
|
|
|
|
.vector-below-page-title {
|
|
|
|
.mixin-toc-collapsed-floating();
|
2022-06-08 15:03:38 +00:00
|
|
|
}
|
|
|
|
}
|
2022-07-08 16:13:32 +00:00
|
|
|
|
|
|
|
@media ( min-width: @min-width-desktop ) {
|
|
|
|
@supports ( display: grid ) {
|
2022-07-26 20:57:51 +00:00
|
|
|
.client-js {
|
2022-07-01 20:19:57 +00:00
|
|
|
// Collapsed to page title
|
2022-08-04 20:05:36 +00:00
|
|
|
.vector-toc-collapsed {
|
2022-07-01 20:19:57 +00:00
|
|
|
.mixin-toc-collapsed-unmoved();
|
2022-07-26 20:57:51 +00:00
|
|
|
|
|
|
|
.mw-table-of-contents-container {
|
|
|
|
grid-area: content;
|
|
|
|
}
|
|
|
|
|
2022-07-01 20:19:57 +00:00
|
|
|
@{sidebar-toc-selector} {
|
|
|
|
top: ~'calc(@{height-collapsed-toc-button} + @{padding-top-content-px})'; // 44px
|
2022-07-26 20:57:51 +00:00
|
|
|
left: -@icon-padding-md;
|
|
|
|
}
|
2022-07-01 20:19:57 +00:00
|
|
|
|
|
|
|
// Collapsed to floating icon
|
|
|
|
// when sticky header not visible and below page title
|
|
|
|
body:not( .vector-sticky-header-visible ).vector-below-page-title& {
|
|
|
|
.mixin-toc-collapsed-floating();
|
|
|
|
}
|
2022-07-08 16:13:32 +00:00
|
|
|
|
2022-07-26 20:57:51 +00:00
|
|
|
.vector-toc-uncollapse-button {
|
|
|
|
display: inline-block;
|
|
|
|
}
|
2022-07-08 16:13:32 +00:00
|
|
|
}
|
|
|
|
|
2022-07-26 20:57:51 +00:00
|
|
|
body:not( .vector-toc-collapsed ) {
|
|
|
|
.vector-toc-collapse-button {
|
|
|
|
display: inline-block;
|
|
|
|
}
|
2022-07-08 16:13:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|