2022-01-11 19:52:26 +00:00
|
|
|
@import '../../common/variables.less';
|
|
|
|
|
2022-07-08 17:51:28 +00:00
|
|
|
@sidebar-toc-fade-height: 30px;
|
|
|
|
@sidebar-toc-vertical-padding: 20px;
|
|
|
|
@sidebar-toc-right-padding: 12px;
|
2022-07-20 01:18:07 +00:00
|
|
|
// Sidebar TOC uses increased left padding and a negative left margin to achieve
|
|
|
|
// a 15px spacing without clipping the chevron icon
|
|
|
|
// https://phabricator.wikimedia.org/T312156#8095894
|
2022-10-27 22:19:39 +00:00
|
|
|
@sidebar-toc-left-padding: 15px + @sidebar-toc-right-padding;
|
2022-07-08 17:51:28 +00:00
|
|
|
@toc-subsection-toggle-icon-size: 1.834em;
|
2022-01-11 19:52:26 +00:00
|
|
|
|
2022-08-22 20:23:14 +00:00
|
|
|
.mw-table-of-contents-container {
|
2022-08-24 18:53:37 +00:00
|
|
|
// Needed for Grid-based layout
|
|
|
|
align-self: start;
|
|
|
|
height: 100%;
|
2022-10-26 17:01:12 +00:00
|
|
|
|
|
|
|
.vector-feature-visual-enhancement-next-disabled & {
|
|
|
|
margin-left: 0;
|
|
|
|
}
|
2022-10-28 21:50:42 +00:00
|
|
|
|
|
|
|
// Only the sticky TOC should be flushed.
|
|
|
|
.vector-sticky-toc-container.mw-ui-icon-flush-left {
|
|
|
|
margin-left: 0;
|
|
|
|
}
|
2022-08-24 18:53:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.vector-sticky-toc-container {
|
|
|
|
// stylelint-disable-next-line plugin/no-unsupported-browser-features
|
|
|
|
position: sticky;
|
|
|
|
top: 0;
|
|
|
|
|
2022-10-28 21:50:42 +00:00
|
|
|
.vector-feature-visual-enhancement-next-disabled & {
|
|
|
|
margin-left: 0;
|
|
|
|
}
|
|
|
|
|
2022-08-24 18:53:37 +00:00
|
|
|
@media ( min-width: @min-width-desktop ) {
|
|
|
|
.vector-toc-not-collapsed & {
|
|
|
|
// Default spacing separating the sidebar TOC from the main menu or viewport.
|
|
|
|
// Need to use padding in order for the spacing to apply when sticky
|
|
|
|
padding-top: 1.5em;
|
|
|
|
}
|
|
|
|
|
|
|
|
.vector-toc-not-collapsed @{selector-main-menu-closed} ~ .mw-table-of-contents-container & {
|
|
|
|
// Needed to align TOC with bottom of title, 1.5em padding + 1.5em margin = 3em
|
|
|
|
margin-top: 1.5em;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-27 22:19:39 +00:00
|
|
|
.sidebar-toc,
|
|
|
|
.sidebar-toc:after {
|
|
|
|
// T312156 Update TOC spacing after removing background color
|
|
|
|
// Align the left edge of the TOC text with the main menu button icon.
|
|
|
|
margin-left: -@sidebar-toc-left-padding;
|
2022-09-15 18:53:18 +00:00
|
|
|
}
|
|
|
|
|
2022-01-11 19:52:26 +00:00
|
|
|
.sidebar-toc {
|
2022-03-17 18:35:43 +00:00
|
|
|
max-height: 75vh;
|
2022-07-20 01:18:07 +00:00
|
|
|
padding: @sidebar-toc-vertical-padding @sidebar-toc-right-padding @sidebar-toc-vertical-padding @sidebar-toc-left-padding;
|
2022-05-12 20:17:03 +00:00
|
|
|
box-sizing: border-box;
|
2022-09-09 16:22:07 +00:00
|
|
|
overflow-y: auto;
|
|
|
|
overflow-x: hidden;
|
2022-07-20 01:18:07 +00:00
|
|
|
background-color: @background-color-page-container;
|
2022-01-11 19:52:26 +00:00
|
|
|
|
|
|
|
.sidebar-toc-header {
|
|
|
|
padding-bottom: 12px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.sidebar-toc-title {
|
2022-04-28 18:07:34 +00:00
|
|
|
color: @color-base--subtle;
|
|
|
|
font-size: @font-size-base;
|
2022-01-11 19:52:26 +00:00
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
border: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.sidebar-toc-numb {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2022-07-08 17:51:28 +00:00
|
|
|
.sidebar-toc-toggle {
|
|
|
|
// For no-js users, toggling is disabled and icon is hidden
|
|
|
|
display: none;
|
|
|
|
position: absolute;
|
|
|
|
top: 1px; // visually center icon
|
|
|
|
left: ~'calc( -1 * @{toc-subsection-toggle-icon-size} - 1px )'; // leaves 6px between icon + text
|
|
|
|
width: @toc-subsection-toggle-icon-size; // ~22px @ 12
|
|
|
|
height: @toc-subsection-toggle-icon-size;
|
|
|
|
font-size: 0.75em; // reduces size of toggle icon to 12px @ 16
|
|
|
|
transition: @transition-duration-base;
|
2022-09-20 21:32:53 +00:00
|
|
|
color: transparent;
|
2022-07-08 17:51:28 +00:00
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
|
2022-04-28 18:07:34 +00:00
|
|
|
.sidebar-toc-link {
|
2022-05-02 18:33:59 +00:00
|
|
|
word-break: break-word;
|
2022-04-28 18:07:34 +00:00
|
|
|
color: @color-link;
|
2022-07-18 15:28:09 +00:00
|
|
|
display: block;
|
2022-04-28 18:07:34 +00:00
|
|
|
}
|
|
|
|
|
2022-09-20 21:32:53 +00:00
|
|
|
// Highlight and bold active sections, active top sections that are unexpanded
|
|
|
|
// and active top sections that are the only active element.
|
|
|
|
.sidebar-toc-list-item-active,
|
|
|
|
.sidebar-toc-level-1-active:not( .sidebar-toc-list-item-expanded ),
|
|
|
|
.sidebar-toc-list-item-active.sidebar-toc-level-1-active {
|
|
|
|
> .sidebar-toc-link {
|
|
|
|
// Highlight active section
|
|
|
|
color: @color-base;
|
|
|
|
font-weight: bold;
|
|
|
|
|
|
|
|
.sidebar-toc-text {
|
|
|
|
// Increase width to prevent line wrapping due to bold text
|
|
|
|
// Avoid applying on link element to avoid focus indicator changing size
|
|
|
|
width: ~'calc( 100% + @{sidebar-toc-right-padding} )';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Highlight active top sections that contain an active section
|
|
|
|
.sidebar-toc-level-1-active:not( .sidebar-toc-list-item-active ) > .sidebar-toc-link {
|
2022-07-08 17:51:28 +00:00
|
|
|
color: @color-base;
|
|
|
|
}
|
|
|
|
|
2022-01-11 19:52:26 +00:00
|
|
|
.sidebar-toc-text {
|
2022-04-28 18:21:52 +00:00
|
|
|
padding: 4px 0;
|
2022-01-11 19:52:26 +00:00
|
|
|
}
|
|
|
|
|
2022-03-17 18:35:43 +00:00
|
|
|
.sidebar-toc-contents,
|
2022-02-07 19:20:17 +00:00
|
|
|
.sidebar-toc-list {
|
2022-01-11 19:52:26 +00:00
|
|
|
margin: 0;
|
|
|
|
list-style: none;
|
|
|
|
line-height: 18px;
|
2022-02-07 19:20:17 +00:00
|
|
|
}
|
2022-01-11 19:52:26 +00:00
|
|
|
|
2022-02-07 19:20:17 +00:00
|
|
|
.sidebar-toc-list-item {
|
|
|
|
display: block;
|
|
|
|
position: relative;
|
|
|
|
list-style-type: none;
|
2022-04-28 18:21:52 +00:00
|
|
|
padding-left: 8px;
|
2022-01-11 19:52:26 +00:00
|
|
|
|
2022-07-08 17:51:28 +00:00
|
|
|
&.sidebar-toc-level-1 {
|
|
|
|
padding-left: 0;
|
|
|
|
}
|
|
|
|
|
2022-02-07 19:20:17 +00:00
|
|
|
a {
|
|
|
|
font-size: @font-size-base;
|
|
|
|
}
|
|
|
|
}
|
2022-01-11 19:52:26 +00:00
|
|
|
}
|
|
|
|
|
2022-07-01 20:19:57 +00:00
|
|
|
// T302076: Add fade scrollable indicator when TOC is in sidebar
|
2022-08-23 16:21:11 +00:00
|
|
|
// Avoid showing indicator when the TOC is floating, or collapsed in the page title/sticky header
|
2022-07-01 20:19:57 +00:00
|
|
|
@media ( min-width: @min-width-desktop ) {
|
2022-08-23 16:21:11 +00:00
|
|
|
.vector-toc-not-collapsed .sidebar-toc:after {
|
2022-07-01 20:19:57 +00:00
|
|
|
content: '';
|
|
|
|
display: block;
|
|
|
|
position: absolute;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
height: @sidebar-toc-fade-height;
|
|
|
|
background: linear-gradient( rgba( 255, 255, 255, 0 ), @background-color-page-container );
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-position: -@sidebar-toc-right-padding; // T311436 Hacky way to prevent the fade from covering the scrollbar
|
|
|
|
pointer-events: none; // Make the link below the fade clickable
|
|
|
|
}
|
2022-03-17 18:35:43 +00:00
|
|
|
}
|
|
|
|
|
2022-04-21 16:51:47 +00:00
|
|
|
// Collapse ToC sections by default, excluding no-js
|
|
|
|
.client-js .sidebar-toc {
|
|
|
|
.sidebar-toc-level-1 .sidebar-toc-list-item {
|
|
|
|
display: none;
|
|
|
|
}
|
2022-02-07 19:20:17 +00:00
|
|
|
|
2022-04-21 16:51:47 +00:00
|
|
|
.sidebar-toc-level-1.sidebar-toc-list-item-expanded .sidebar-toc-list-item {
|
|
|
|
display: block;
|
|
|
|
}
|
2022-02-07 19:20:17 +00:00
|
|
|
|
2022-04-21 16:51:47 +00:00
|
|
|
.sidebar-toc-toggle {
|
|
|
|
display: block;
|
|
|
|
}
|
2022-02-07 19:20:17 +00:00
|
|
|
|
2022-04-21 16:51:47 +00:00
|
|
|
.sidebar-toc-level-1.sidebar-toc-list-item-expanded .sidebar-toc-toggle {
|
|
|
|
transform: rotate( 0deg );
|
2022-02-07 19:20:17 +00:00
|
|
|
}
|
|
|
|
}
|
2022-03-17 22:58:44 +00:00
|
|
|
|
2022-05-29 19:43:20 +00:00
|
|
|
.client-js body.ltr .sidebar-toc .sidebar-toc-toggle {
|
|
|
|
transform: rotate( -90deg );
|
|
|
|
}
|
|
|
|
|
|
|
|
.client-js body.rtl .sidebar-toc .sidebar-toc-toggle {
|
|
|
|
transform: rotate( 90deg );
|
|
|
|
}
|