mediawiki-skins-Citizen/resources/skins.citizen.styles.toc/skins.citizen.styles.toc.less

224 lines
4.3 KiB
Plaintext
Raw Normal View History

2020-06-16 02:32:55 +00:00
@import '../variables.less';
@import '../mixins.less';
2021-03-07 18:11:15 +00:00
@media screen {
html {
// Make ToC width accessible as CSS var
--width-toc: @width-toc;
}
2021-03-07 18:11:15 +00:00
.toc {
position: fixed;
top: var( --height-header );
left: 0;
max-width: ~'calc( var( --width-toc ) - '@padding-page * 2 ~')';
2021-03-07 18:11:15 +00:00
padding: @padding-page;
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;
}
}
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-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,
li {
color: var( --color-base );
}
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;
color: var( --color-base--subtle );
2020-06-10 22:02:22 +00:00
2021-03-07 18:11:15 +00:00
&:hover {
color: var( --color-base );
}
&:active {
color: var( --color-base--subtle );
}
}
2021-03-07 18:11:15 +00:00
&number {
.mixin-screen-reader-text;
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;
2021-03-18 16:35:44 +00:00
max-height: ~'calc( 100vh - var( --height-header ) * 2 )';
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
height: 100%;
padding: 0;
margin-top: ~'calc( var( --height-header ) * -1 )';
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-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;
width: 39px;
height: 56px;
padding: 0 @margin-side / 2;
border-top: 1px solid var( --border-color-base );
border-left: 1px solid var( --border-color-base );
background-color: var( --background-color-dp-06 );
border-radius: @border-radius-large 0 0 0;
pointer-events: auto;
.boxshadow(4);
&:hover {
background-color: var( --background-color-dp-12 );
.boxshadow(5);
&:before {
opacity: var( --opacity-icon-base--hover );
}
2020-06-10 22:02:22 +00:00
}
2021-03-07 18:11:15 +00:00
&:active {
background-color: var( --background-color-dp-02 );
&:before {
opacity: var( --opacity-icon-base--active );
}
}
&:before {
2021-03-07 18:11:15 +00:00
.resource-loader-icon;
display: block;
opacity: var( --opacity-icon-base );
}
2020-06-10 22:02:22 +00:00
}
2021-03-07 18:11:15 +00:00
&checkbox:not( :checked ) {
~ .toctitle h2,
~ ul {
transform: translateX( -120% );
2021-03-07 18:11:15 +00:00
}
2020-06-10 22:02:22 +00:00
}
}
2021-03-07 18:11:15 +00:00
&title h2 {
position: absolute;
z-index: 3;
max-width: var( --width-toc );
2021-03-07 18:11:15 +00:00
padding: 10px var( --padding-page ) 0 var( --padding-page );
margin-top: var( --height-header );
}
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
min-width: ~'calc( var( --width-toc ) - var( --padding-page ) * 2 )'; // To prevent heading overflow
max-width: ~'calc( 100vh - var( --padding-page ) * 2 )';
2021-03-07 18:11:15 +00:00
height: 100%;
2021-03-18 16:35:44 +00:00
max-height: ~'calc( 100vh - var( --height-header ) )';
2021-03-07 18:11:15 +00:00
padding: ~'calc( var( --height-header ) + 24px + 0.6rem ) var( --padding-page ) 20px var( --padding-page )';
margin: 0 !important;
2021-03-12 02:53:54 +00:00
background: var( --background-color-dp-08 );
2021-03-07 18:11:15 +00:00
border-radius: 0 @border-radius-large @border-radius-large 0;
pointer-events: auto;
.boxshadow(3);
}
2020-06-10 22:02:22 +00:00
}
.citizen-animations-ready {
.toc {
&title h2,
> ul {
transition: @transition-transform-quick;
}
}
}
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
}
}
@media ( min-width: @width-breakpoint-desktop-wide ) {
2021-03-07 18:11:15 +00:00
.skin-citizen-has-toc {
.mw-body-header,
.mw-body-content {
margin-right: ~'max( var( --margin-layout ), 0 )';
margin-left: ~'max( var( --margin-layout ), var( --width-toc ) )';
2021-03-07 18:11:15 +00:00
}
}
}
}