2020-06-16 02:32:55 +00:00
|
|
|
@import '../variables.less';
|
|
|
|
@import '../mixins.less';
|
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
@media screen {
|
2021-03-18 17:39:13 +00:00
|
|
|
html {
|
|
|
|
// Make ToC width accessible as CSS var
|
|
|
|
--width-toc: @width-toc;
|
|
|
|
}
|
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
.toc {
|
|
|
|
position: fixed;
|
2022-05-03 20:03:34 +00:00
|
|
|
top: ~'calc( var( --height-header ) + 1.2rem )'; // align with .mw-body-header
|
|
|
|
left: var( --padding-page );
|
2021-04-30 14:34:50 +00:00
|
|
|
width: 100%;
|
2022-05-03 20:03:34 +00:00
|
|
|
max-width: ~'calc( var( --width-toc ) - var( --padding-page ) * 2 )';
|
2021-03-07 18:11:15 +00:00
|
|
|
color: var( --color-base--subtle );
|
|
|
|
font-size: @ui-menu-text;
|
2020-06-10 22:02:22 +00:00
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
&::-webkit-scrollbar {
|
|
|
|
width: 0; // Hide bar on toc
|
2020-06-10 22:02:22 +00:00
|
|
|
}
|
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
&title {
|
|
|
|
h2 {
|
|
|
|
margin: 0;
|
|
|
|
color: var( --color-base--subtle ) !important;
|
|
|
|
font-size: inherit;
|
|
|
|
font-weight: normal;
|
|
|
|
letter-spacing: 0.75px;
|
|
|
|
}
|
2020-08-09 20:56:45 +00:00
|
|
|
}
|
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
&toggle {
|
|
|
|
&span {
|
|
|
|
display: none;
|
|
|
|
}
|
2020-06-10 22:02:22 +00:00
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
&checkbox:checked ~ ul {
|
|
|
|
display: block !important; // Force display
|
|
|
|
}
|
|
|
|
}
|
2021-01-13 17:56:48 +00:00
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
li {
|
|
|
|
border-left: 2px solid var( --border-color-base--darker );
|
|
|
|
|
|
|
|
&.toclevel-2,
|
|
|
|
&.toclevel-3,
|
|
|
|
&.toclevel-4,
|
|
|
|
&.toclevel-5,
|
|
|
|
&.toclevel-6 {
|
|
|
|
margin-left: 10px;
|
|
|
|
}
|
2020-06-10 22:02:22 +00:00
|
|
|
}
|
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
li.active {
|
|
|
|
border-color: var( --color-primary );
|
|
|
|
color: var( --color-primary );
|
2020-06-10 22:02:22 +00:00
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
> a {
|
|
|
|
color: inherit !important;
|
|
|
|
}
|
2020-06-10 22:02:22 +00:00
|
|
|
}
|
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
a {
|
|
|
|
display: block;
|
|
|
|
padding: 0.25rem 0 0.25rem 10px;
|
2021-08-26 15:18:25 +00:00
|
|
|
color: var( --color-base );
|
2020-06-10 22:02:22 +00:00
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
&:hover {
|
2021-08-26 15:18:25 +00:00
|
|
|
color: var( --color-primary--hover );
|
2021-03-07 18:11:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&:active {
|
2021-08-26 15:18:25 +00:00
|
|
|
color: var( --color-primary--active );
|
2021-03-07 18:11:15 +00:00
|
|
|
}
|
2021-01-12 20:13:24 +00:00
|
|
|
}
|
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
&number {
|
2022-04-17 22:12:11 +00:00
|
|
|
display: none;
|
2021-08-26 15:18:25 +00:00
|
|
|
margin-right: 4px;
|
|
|
|
opacity: 0.7;
|
|
|
|
}
|
|
|
|
|
|
|
|
&text {
|
|
|
|
font-weight: 500;
|
2020-06-10 22:02:22 +00:00
|
|
|
}
|
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
ul {
|
|
|
|
margin: 0 !important;
|
|
|
|
list-style: none;
|
|
|
|
}
|
2020-06-10 22:02:22 +00:00
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
> ul {
|
|
|
|
position: relative;
|
|
|
|
z-index: 2;
|
|
|
|
display: block;
|
|
|
|
overflow: visible auto;
|
2022-05-03 20:03:34 +00:00
|
|
|
max-height: ~'calc( 100vh - var( --height-header ) - 3rem )'; // Somehow it works
|
2021-04-30 14:34:50 +00:00
|
|
|
padding-right: 10px;
|
2021-03-07 18:11:15 +00:00
|
|
|
margin: @content-margin-top * 0.75 0 0 0 !important;
|
|
|
|
font-weight: 450;
|
|
|
|
overscroll-behavior: contain;
|
|
|
|
}
|
2020-06-10 22:02:22 +00:00
|
|
|
}
|
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
@media ( max-width: @width-breakpoint-desktop-wide ) {
|
|
|
|
.toc {
|
|
|
|
z-index: 11; // Higher than header
|
|
|
|
padding: 0;
|
2021-04-11 00:55:48 +00:00
|
|
|
margin: 0 var( --padding-page );
|
2021-03-07 18:11:15 +00:00
|
|
|
pointer-events: none;
|
2020-06-10 22:02:22 +00:00
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
&:before,
|
|
|
|
&:after {
|
|
|
|
content: unset; // Disable fade
|
2020-08-09 20:56:45 +00:00
|
|
|
}
|
2020-06-10 22:02:22 +00:00
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
&toggle {
|
|
|
|
&span {
|
|
|
|
display: block;
|
|
|
|
font-size: 0 !important;
|
|
|
|
}
|
2020-06-10 22:02:22 +00:00
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
&label {
|
|
|
|
position: fixed;
|
|
|
|
z-index: 7;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
|
|
|
display: block;
|
2021-07-26 00:21:32 +00:00
|
|
|
width: 48px;
|
|
|
|
height: 48px;
|
2021-03-07 18:11:15 +00:00
|
|
|
border-top: 1px solid var( --border-color-base );
|
|
|
|
border-left: 1px solid var( --border-color-base );
|
2021-07-26 00:21:32 +00:00
|
|
|
background-color: var( --color-surface-2 );
|
2022-05-03 20:03:34 +00:00
|
|
|
border-top-left-radius: var( --border-radius--medium );
|
2022-04-24 19:24:09 +00:00
|
|
|
box-shadow: var( --box-shadow-dialog );
|
2021-07-26 00:21:32 +00:00
|
|
|
cursor: pointer;
|
2021-03-07 18:11:15 +00:00
|
|
|
pointer-events: auto;
|
|
|
|
|
|
|
|
&:hover {
|
2021-07-26 00:21:32 +00:00
|
|
|
background-color: var( --color-surface-3 );
|
2021-03-07 18:11:15 +00:00
|
|
|
|
|
|
|
&:before {
|
|
|
|
opacity: var( --opacity-icon-base--hover );
|
|
|
|
}
|
2020-06-10 22:02:22 +00:00
|
|
|
}
|
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
&:active {
|
2021-07-26 00:21:32 +00:00
|
|
|
background-color: var( --color-surface-1 );
|
2021-03-07 18:11:15 +00:00
|
|
|
|
|
|
|
&:before {
|
|
|
|
opacity: var( --opacity-icon-base--active );
|
|
|
|
}
|
|
|
|
}
|
2021-01-14 17:26:25 +00:00
|
|
|
|
|
|
|
&:before {
|
2021-03-07 18:11:15 +00:00
|
|
|
.resource-loader-icon;
|
|
|
|
display: block;
|
|
|
|
opacity: var( --opacity-icon-base );
|
2021-01-14 17:26:25 +00:00
|
|
|
}
|
2020-06-10 22:02:22 +00:00
|
|
|
}
|
|
|
|
|
2022-05-03 20:03:34 +00:00
|
|
|
// By default .toccheckbox is checked on page load
|
|
|
|
// This is needed to prevent ToC popping up on mobile
|
2021-03-07 18:11:15 +00:00
|
|
|
&checkbox:not( :checked ) {
|
|
|
|
~ .toctitle h2,
|
|
|
|
~ ul {
|
2021-03-18 17:39:13 +00:00
|
|
|
transform: translateX( -120% );
|
2021-03-07 18:11:15 +00:00
|
|
|
}
|
2020-06-10 22:02:22 +00:00
|
|
|
}
|
|
|
|
}
|
2020-08-09 21:32:12 +00:00
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
&title h2 {
|
|
|
|
position: absolute;
|
|
|
|
z-index: 3;
|
2021-04-11 00:55:48 +00:00
|
|
|
width: ~'calc( 100% - var( --padding-page ) * 2 )';
|
2021-04-26 16:04:52 +00:00
|
|
|
padding: 20px var( --padding-page ) 10px var( --padding-page );
|
2021-07-25 23:16:05 +00:00
|
|
|
background: var( --color-surface-1 );
|
2022-05-03 20:03:34 +00:00
|
|
|
border-radius: var( --border-radius--medium ) var( --border-radius--medium ) 0 0;
|
2020-08-09 20:56:45 +00:00
|
|
|
}
|
2020-06-10 22:02:22 +00:00
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
> ul {
|
|
|
|
display: block !important; // So that animation is visible
|
2021-04-11 00:55:48 +00:00
|
|
|
max-height: ~'calc( 100vh - var( --height-header ) * 3 )';
|
2021-04-30 14:34:50 +00:00
|
|
|
padding: 0 var( --padding-page ) 20px var( --padding-page ); // hardcoded for now
|
|
|
|
margin: 45px 0 0 0 !important;
|
2021-07-25 23:16:05 +00:00
|
|
|
background: var( --color-surface-1 );
|
2022-05-03 20:03:34 +00:00
|
|
|
border-radius: 0 0 var( --border-radius--medium ) var( --border-radius--medium );
|
2022-04-24 19:24:09 +00:00
|
|
|
box-shadow: var( --box-shadow-dialog );
|
2021-03-07 18:11:15 +00:00
|
|
|
pointer-events: auto;
|
|
|
|
}
|
2020-06-10 22:02:22 +00:00
|
|
|
}
|
|
|
|
|
2021-03-13 17:43:28 +00:00
|
|
|
.citizen-animations-ready {
|
|
|
|
.toc {
|
|
|
|
&title h2,
|
|
|
|
> ul {
|
2022-05-01 23:14:17 +00:00
|
|
|
transition: @transition-transform;
|
2021-03-13 17:43:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
.skin-citizen-dark {
|
|
|
|
.toc {
|
|
|
|
&togglelabel {
|
|
|
|
&:before {
|
|
|
|
filter: invert( 1 );
|
|
|
|
}
|
2020-06-10 22:02:22 +00:00
|
|
|
}
|
2020-08-10 03:33:45 +00:00
|
|
|
}
|
2020-06-10 22:02:22 +00:00
|
|
|
}
|
|
|
|
}
|
2021-01-18 20:18:39 +00:00
|
|
|
|
2021-07-26 00:21:32 +00:00
|
|
|
// Special toggle styles on pointer devices since scrollbar is visible
|
|
|
|
@media ( max-width: @width-breakpoint-desktop-wide ) and ( hover: hover ) {
|
|
|
|
.toctogglelabel {
|
|
|
|
border-right: 1px solid var( --border-color-base );
|
2022-05-03 20:03:34 +00:00
|
|
|
border-top-right-radius: var( --border-radius--medium );
|
2021-07-26 00:21:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 00:55:48 +00:00
|
|
|
@media ( max-width: @width-breakpoint-tablet ) {
|
|
|
|
.toc {
|
|
|
|
right: 0;
|
|
|
|
|
|
|
|
> ul {
|
|
|
|
max-height: 60vh;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-30 14:34:50 +00:00
|
|
|
@media ( max-width: @width-breakpoint-mobile ) {
|
|
|
|
.toc {
|
|
|
|
max-width: ~'calc(100vw - var( --padding-page ) * 2)';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-18 17:39:13 +00:00
|
|
|
@media ( min-width: @width-breakpoint-desktop-wide ) {
|
2021-03-07 18:11:15 +00:00
|
|
|
.skin-citizen-has-toc {
|
|
|
|
.mw-body-header,
|
2021-07-30 15:44:02 +00:00
|
|
|
.citizen-body {
|
2021-03-18 17:39:13 +00:00
|
|
|
margin-right: ~'max( var( --margin-layout ), 0 )';
|
|
|
|
margin-left: ~'max( var( --margin-layout ), var( --width-toc ) )';
|
2021-03-07 18:11:15 +00:00
|
|
|
}
|
2021-01-18 20:18:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|