2022-01-11 19:52:26 +00:00
|
|
|
@import '../../common/variables.less';
|
|
|
|
|
|
|
|
@subcategory-indent: 8px;
|
|
|
|
|
|
|
|
.sidebar-toc {
|
|
|
|
width: 200px;
|
|
|
|
max-height: 90vh;
|
|
|
|
overflow: auto;
|
2022-02-07 19:20:17 +00:00
|
|
|
padding: 12px 12px 12px 26px;
|
2022-01-11 19:52:26 +00:00
|
|
|
float: left;
|
|
|
|
position: sticky;
|
|
|
|
top: calc( @height-sticky-header + 1.5em );
|
|
|
|
background-color: @background-color-base;
|
|
|
|
border: @border-base;
|
|
|
|
border-radius: @border-radius-base;
|
|
|
|
|
|
|
|
.sidebar-toc-header {
|
|
|
|
padding-bottom: 12px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.sidebar-toc-title {
|
|
|
|
font-weight: bold;
|
|
|
|
font-size: @font-size-heading-3;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
border: 0;
|
|
|
|
}
|
|
|
|
|
2022-01-21 20:15:34 +00:00
|
|
|
.sidebar-toc-link > * {
|
|
|
|
// Prevent click events on the link's contents so that we can use event
|
|
|
|
// delegation and have the target be the anchor element instead.
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
|
|
|
|
2022-01-11 19:52:26 +00:00
|
|
|
.sidebar-toc-numb {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.sidebar-toc-text {
|
|
|
|
padding-bottom: 5px;
|
|
|
|
}
|
|
|
|
|
2022-02-07 19:20:17 +00:00
|
|
|
#table-of-contents,
|
|
|
|
.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;
|
|
|
|
padding-left: @subcategory-indent;
|
2022-01-11 19:52:26 +00:00
|
|
|
|
2022-02-07 19:20:17 +00:00
|
|
|
a {
|
|
|
|
color: @color-base;
|
|
|
|
font-size: @font-size-base;
|
|
|
|
}
|
|
|
|
}
|
2022-01-11 19:52:26 +00:00
|
|
|
|
2022-02-07 19:20:17 +00:00
|
|
|
.sidebar-toc-list-item.sidebar-toc-level-1 {
|
|
|
|
padding-left: 0;
|
2022-01-11 19:52:26 +00:00
|
|
|
|
2022-02-07 19:20:17 +00:00
|
|
|
& > a {
|
|
|
|
color: @color-link;
|
2022-01-11 19:52:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Hide TOC when sidebar is open
|
|
|
|
.mw-checkbox-hack-checkbox:checked ~ .mw-workspace-container .sidebar-toc {
|
|
|
|
display: none;
|
|
|
|
}
|
2022-02-07 19:20:17 +00:00
|
|
|
|
|
|
|
// Highlight active section
|
|
|
|
.sidebar-toc .sidebar-toc-list-item-active > .sidebar-toc-link {
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
.sidebar-toc .sidebar-toc-toggle {
|
2022-02-15 22:43:04 +00:00
|
|
|
// For no-js users, toggling is disabled and icon is hidden
|
2022-02-07 19:20:17 +00:00
|
|
|
display: none;
|
2022-02-15 22:43:04 +00:00
|
|
|
cursor: pointer;
|
2022-02-07 19:20:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Collapse ToC sections by default, excluding no-js or prefers-reduced-motion
|
|
|
|
@media ( prefers-reduced-motion: no-preference ) {
|
|
|
|
.client-js .sidebar-toc {
|
|
|
|
.sidebar-toc-level-1 .sidebar-toc-list-item {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.sidebar-toc-level-1.sidebar-toc-list-item-expanded .sidebar-toc-list-item {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
|
|
|
.sidebar-toc-toggle {
|
|
|
|
position: absolute;
|
|
|
|
font-size: 0.7em; // reduces size of toggle icon (by an arbitrary amount)
|
|
|
|
top: 4px; // visually center icon (at least at default font size)
|
|
|
|
left: -18px;
|
|
|
|
transform: rotate( -90deg );
|
|
|
|
}
|
|
|
|
|
|
|
|
.sidebar-toc-level-1 > .sidebar-toc-toggle {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
|
|
|
.sidebar-toc-level-1 > .sidebar-toc-list:empty + .sidebar-toc-toggle {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.sidebar-toc-level-1.sidebar-toc-list-item-expanded .sidebar-toc-toggle {
|
|
|
|
transform: rotate( 0deg );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|