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-09-29 23:12:56 +00:00
|
|
|
top: 3rem;
|
|
|
|
right: var( --space-sm );
|
2021-04-30 14:34:50 +00:00
|
|
|
width: 100%;
|
2022-09-29 23:12:56 +00:00
|
|
|
max-width: ~'calc( var( --width-toc ) - var( --space-sm ) * 2 )';
|
2021-03-07 18:11:15 +00:00
|
|
|
color: var( --color-base--subtle );
|
2022-05-13 17:42:22 +00:00
|
|
|
font-size: 0.875rem;
|
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;
|
2022-05-13 17:42:22 +00:00
|
|
|
color: var( --color-base--subtle );
|
2021-03-07 18:11:15 +00:00
|
|
|
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 {
|
2022-05-13 17:42:22 +00:00
|
|
|
margin-left: 0.75rem;
|
2021-03-07 18:11:15 +00:00
|
|
|
}
|
2020-06-10 22:02:22 +00:00
|
|
|
}
|
|
|
|
|
2022-05-13 04:21:08 +00:00
|
|
|
.toc__item--active {
|
2021-03-07 18:11:15 +00:00
|
|
|
border-color: var( --color-primary );
|
|
|
|
color: var( --color-primary );
|
2020-06-10 22:02:22 +00:00
|
|
|
|
2022-05-13 17:42:22 +00:00
|
|
|
> a,
|
|
|
|
> a:hover,
|
|
|
|
> a:active {
|
|
|
|
color: inherit;
|
2021-03-07 18:11:15 +00:00
|
|
|
}
|
2020-06-10 22:02:22 +00:00
|
|
|
}
|
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
a {
|
|
|
|
display: block;
|
2022-05-13 17:42:22 +00:00
|
|
|
padding: 0.25rem 0 0.25rem 0.75rem;
|
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;
|
2022-05-13 17:42:22 +00:00
|
|
|
margin-right: 0.25rem;
|
2021-08-26 15:18:25 +00:00
|
|
|
opacity: 0.7;
|
|
|
|
}
|
|
|
|
|
|
|
|
&text {
|
|
|
|
font-weight: 500;
|
2020-06-10 22:02:22 +00:00
|
|
|
}
|
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
ul {
|
|
|
|
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-09-30 14:24:16 +00:00
|
|
|
max-height: ~'calc( 100vh - 10rem )'; // Somehow it works
|
2022-05-13 17:42:22 +00:00
|
|
|
padding-right: 0.75rem;
|
|
|
|
margin: 0.6rem 0 0 0;
|
2021-03-07 18:11:15 +00:00
|
|
|
font-weight: 450;
|
|
|
|
overscroll-behavior: contain;
|
2022-05-13 17:42:22 +00:00
|
|
|
|
|
|
|
ul {
|
|
|
|
margin: 0;
|
|
|
|
}
|
2021-03-07 18:11:15 +00:00
|
|
|
}
|
2020-06-10 22:02:22 +00:00
|
|
|
}
|
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
@media ( max-width: @width-breakpoint-desktop-wide ) {
|
|
|
|
.toc {
|
2022-10-03 20:20:41 +00:00
|
|
|
z-index: @z-index-page-header + 1;
|
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
|
|
|
&toggle {
|
|
|
|
&span {
|
|
|
|
display: block;
|
2022-05-13 17:42:22 +00:00
|
|
|
font-size: 0;
|
2021-03-07 18:11:15 +00:00
|
|
|
}
|
2020-06-10 22:02:22 +00:00
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
&label {
|
2022-09-29 23:12:56 +00:00
|
|
|
--label-position: ~'calc( var( --width-toc ) - var( --space-sm ) )';
|
2021-03-07 18:11:15 +00:00
|
|
|
position: fixed;
|
2022-09-29 23:12:56 +00:00
|
|
|
right: var( --label-position );
|
2022-05-13 17:42:22 +00:00
|
|
|
width: 2.5rem;
|
|
|
|
height: 2.5rem;
|
2022-09-29 23:12:56 +00:00
|
|
|
border-bottom-left-radius: var( --border-radius--medium );
|
|
|
|
border-top-left-radius: var( --border-radius--medium );
|
2021-07-26 00:21:32 +00:00
|
|
|
cursor: pointer;
|
2021-03-07 18:11:15 +00:00
|
|
|
pointer-events: auto;
|
2022-05-13 05:12:52 +00:00
|
|
|
.citizen-card( false );
|
2021-03-07 18:11:15 +00:00
|
|
|
|
|
|
|
&: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;
|
2022-05-13 17:42:22 +00:00
|
|
|
background-size: 1rem;
|
2021-03-07 18:11:15 +00:00
|
|
|
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 ) {
|
2022-05-13 05:12:52 +00:00
|
|
|
~ .toctitle .toctogglelabel {
|
2022-09-29 23:12:56 +00:00
|
|
|
transform: translateX( ~'var( --label-position )' );
|
2022-05-13 05:12:52 +00:00
|
|
|
}
|
|
|
|
|
2021-03-07 18:11:15 +00:00
|
|
|
~ .toctitle h2,
|
|
|
|
~ ul {
|
2022-09-29 23:12:56 +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;
|
2022-09-29 23:12:56 +00:00
|
|
|
width: ~'calc( 100% - var( --space-md ) * 2 )';
|
|
|
|
padding: 1rem var( --space-md );
|
2022-05-13 17:42:22 +00:00
|
|
|
|
|
|
|
&:before {
|
|
|
|
position: absolute;
|
|
|
|
z-index: -1;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
left: 0;
|
|
|
|
height: 100%;
|
|
|
|
border-radius: var( --border-radius--medium );
|
2022-09-28 21:02:56 +00:00
|
|
|
background: var( --color-surface-1 );
|
2022-05-13 17:42:22 +00:00
|
|
|
content: '';
|
|
|
|
-webkit-mask-image: linear-gradient( 180deg, #000, transparent );
|
|
|
|
mask-image: linear-gradient( 180deg, #000, transparent );
|
|
|
|
}
|
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
|
2022-09-29 23:12:56 +00:00
|
|
|
max-height: ~'calc( 100vh - var( --header-size ) * 3 )';
|
|
|
|
padding: 2.6rem var( --space-md ) 1rem var( --space-md ); // hardcoded for now
|
|
|
|
border-radius: 0 var( --border-radius--medium ) var( --border-radius--medium ) var( --border-radius--medium );
|
2022-09-28 21:02:56 +00:00
|
|
|
margin-top: 0;
|
2021-03-07 18:11:15 +00:00
|
|
|
pointer-events: auto;
|
2022-05-13 05:12:52 +00:00
|
|
|
.citizen-card( false );
|
|
|
|
}
|
|
|
|
|
|
|
|
&togglelabel,
|
|
|
|
&title h2,
|
|
|
|
> ul {
|
|
|
|
transition: @transition-opacity;
|
2021-03-07 18:11:15 +00:00
|
|
|
}
|
2020-06-10 22:02:22 +00:00
|
|
|
}
|
|
|
|
|
2021-03-13 17:43:28 +00:00
|
|
|
.citizen-animations-ready {
|
|
|
|
.toc {
|
2022-05-13 05:12:52 +00:00
|
|
|
&togglelabel,
|
2021-03-13 17:43:28 +00:00
|
|
|
&title h2,
|
|
|
|
> ul {
|
2022-05-13 05:12:52 +00:00
|
|
|
transition: @transition-transform, @transition-opacity;
|
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-04-11 00:55:48 +00:00
|
|
|
@media ( max-width: @width-breakpoint-tablet ) {
|
|
|
|
.toc {
|
2022-09-29 23:12:56 +00:00
|
|
|
right: var( --space-sm );
|
2021-04-11 00:55:48 +00:00
|
|
|
|
|
|
|
> ul {
|
|
|
|
max-height: 60vh;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-30 14:34:50 +00:00
|
|
|
@media ( max-width: @width-breakpoint-mobile ) {
|
|
|
|
.toc {
|
2022-09-29 23:12:56 +00:00
|
|
|
max-width: ~'calc(100vw - var( --space-sm ) * 2)';
|
2021-04-30 14:34:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-18 17:39:13 +00:00
|
|
|
@media ( min-width: @width-breakpoint-desktop-wide ) {
|
2022-05-12 21:01:01 +00:00
|
|
|
.citizen-toc-enabled {
|
2021-03-07 18:11:15 +00:00
|
|
|
.mw-body-header,
|
2022-10-01 20:07:37 +00:00
|
|
|
.citizen-body,
|
|
|
|
.mw-body-footer {
|
2022-09-29 23:12:56 +00:00
|
|
|
// Reserve space for ToC
|
|
|
|
padding-right: var( --width-toc );
|
2021-03-07 18:11:15 +00:00
|
|
|
}
|
2021-01-18 20:18:39 +00:00
|
|
|
}
|
2022-09-30 02:33:06 +00:00
|
|
|
|
|
|
|
.citizen-animations-ready {
|
|
|
|
.toc {
|
|
|
|
transition: @transition-transform;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.citizen-body-header--sticky {
|
|
|
|
.toc {
|
|
|
|
transform: translateY( 3rem );
|
|
|
|
}
|
|
|
|
}
|
2021-01-18 20:18:39 +00:00
|
|
|
}
|
|
|
|
}
|