mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-29 18:05:19 +00:00
83f324e863
Bug: T302076 Change-Id: I9fffb17e60182ef2d667ed86218b8f24e1d76f5c
137 lines
2.8 KiB
Plaintext
137 lines
2.8 KiB
Plaintext
@import '../../common/variables.less';
|
|
|
|
@subcategory-indent: 8px;
|
|
@fade-height: 40px;
|
|
@vertical-padding: 25px;
|
|
|
|
.sidebar-toc {
|
|
display: none;
|
|
width: @width-sidebar;
|
|
max-height: 75vh;
|
|
padding: @vertical-padding 12px 0 26px;
|
|
.box-sizing( border-box );
|
|
overflow: auto;
|
|
background-color: @border-color-sidebar;
|
|
border: @border-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;
|
|
}
|
|
|
|
.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;
|
|
}
|
|
|
|
.sidebar-toc-numb {
|
|
display: none;
|
|
}
|
|
|
|
.sidebar-toc-text {
|
|
padding-bottom: 5px;
|
|
}
|
|
|
|
.sidebar-toc-contents,
|
|
.sidebar-toc-list {
|
|
margin: 0;
|
|
list-style: none;
|
|
line-height: 18px;
|
|
}
|
|
|
|
.sidebar-toc-contents {
|
|
margin-bottom: -@fade-height;
|
|
padding-bottom: @vertical-padding;
|
|
}
|
|
|
|
.sidebar-toc-list-item {
|
|
display: block;
|
|
position: relative;
|
|
list-style-type: none;
|
|
padding-left: @subcategory-indent;
|
|
|
|
a {
|
|
color: @color-base;
|
|
font-size: @font-size-base;
|
|
}
|
|
}
|
|
|
|
.sidebar-toc-list-item.sidebar-toc-level-1 {
|
|
padding-left: 0;
|
|
|
|
& > a {
|
|
color: @color-link;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Hide scrollbar but allow scrolling for Chrome, Safari, and Opera
|
|
.sidebar-toc::-webkit-scrollbar {
|
|
display: none;
|
|
}
|
|
|
|
// T302076 Add scrollable indicator as fade
|
|
.mw-table-of-contents-container:after {
|
|
content: '';
|
|
display: block;
|
|
position: relative;
|
|
bottom: @fade-height;
|
|
left: 0;
|
|
height: @fade-height;
|
|
background: linear-gradient( rgba( 255, 255, 255, 0 ), @border-color-sidebar );
|
|
pointer-events: none; // Make the link below the fade clickable
|
|
border: @border-base;
|
|
border-top: 0;
|
|
}
|
|
|
|
// Highlight active section
|
|
.sidebar-toc .sidebar-toc-list-item-active > .sidebar-toc-link {
|
|
font-weight: bold;
|
|
}
|
|
|
|
.sidebar-toc .sidebar-toc-toggle {
|
|
// For no-js users, toggling is disabled and icon is hidden
|
|
display: none;
|
|
cursor: pointer;
|
|
}
|
|
|
|
// 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;
|
|
display: block;
|
|
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-list-item-expanded .sidebar-toc-toggle {
|
|
transform: rotate( 0deg );
|
|
}
|
|
}
|
|
}
|
|
|
|
@media ( min-width: @width-breakpoint-tablet ) {
|
|
.sidebar-toc {
|
|
display: block;
|
|
}
|
|
}
|