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

215 lines
4.2 KiB
Plaintext
Raw Normal View History

2020-06-16 02:32:55 +00:00
@import '../variables.less';
@import '../mixins.less';
:root {
--toc-color: @base-70;
--toc-title-h2-color: @base-50;
--toc-li-active-color: @accent-50;
--toc-li-active-a-li-color: @base-30;
--toc-a-color: @base-50;
--toc-a-hover-color: @base-30;
--screen3-toc-toggle-label-background-color: @base-90;
--screen3-toc-toggle-label-hover-background-color: @base-80;
--screen3-toc-toggle-label-focus-background-color: @accent-90;
--screen3-toc-ul-background-color: @base-100;
}
:root.skin-citizen-dark {
--toc-color: @dark-text-60;
--toc-title-h2-color: @base-50;
--toc-li-active-color: @dark-color-link;
--toc-li-active-a-li-color: @dark-text-80;
--toc-a-color: @dark-text-70;
--toc-a-hover-color: @dark-text-80;
--screen3-toc-toggle-label-background-color: @dark-bg-50;
--screen3-toc-toggle-label-hover-background-color: @accent-10;
--screen3-toc-toggle-label-focus-background-color: @accent-10;
--screen3-toc-ul-background-color: @dark-bg-40;
}
2020-06-10 22:02:22 +00:00
.toc {
position: fixed;
z-index: -1; // So that it is below float objects in content
2020-06-10 22:02:22 +00:00
max-width: 450px;
top: @header-height;
2020-06-11 19:36:26 +00:00
left: 0;
2020-06-10 22:02:22 +00:00
padding: @margin-side;
color: var( --toc-color );
2020-06-10 22:02:22 +00:00
&::-webkit-scrollbar {
width: 0; // Hide bar on toc
}
&title {
h2 {
margin: 0;
color: var( --toc-title-h2-color ) !important;
2020-06-10 22:02:22 +00:00
font-size: @ui-menu-text-big;
}
}
&toggle {
&span {
display: none;
}
&checkbox:checked ~ ul {
display: block !important; // Force display
}
2020-06-10 22:02:22 +00:00
}
li {
&.toclevel-2,
&.toclevel-3,
&.toclevel-4,
&.toclevel-5,
&.toclevel-6 {
2020-06-11 19:52:05 +00:00
margin-left: 9px;
2020-06-11 19:36:26 +00:00
border-left: 1px dashed;
2020-06-10 22:02:22 +00:00
}
}
li.active {
color: var( --toc-li-active-a-li-color );
2020-06-10 22:02:22 +00:00
> a {
color: inherit !important;
border-color: currentColor;
}
a,
li {
color: var( --toc-li-active-a-li-color );
2020-06-10 22:02:22 +00:00
}
}
a {
display: inline-block;
2020-06-11 20:06:02 +00:00
margin: @content-margin-top / 4 0;
2020-06-11 19:52:05 +00:00
padding-left: 9px;
color: var( --toc-a-color );
2020-06-11 19:36:26 +00:00
border-left: 3px solid transparent;
2020-06-10 22:02:22 +00:00
&:hover {
color: var( --toc-a-hover-color );
2020-06-10 22:02:22 +00:00
}
}
&number {
.mixin-screen-reader-text;
}
ul {
2020-06-11 19:36:26 +00:00
margin: 0 !important;
2020-06-10 22:02:22 +00:00
list-style: none;
}
> ul {
2020-06-11 19:36:26 +00:00
margin: @content-margin-top * 0.75 0 0 0 !important;
2020-06-10 22:02:22 +00:00
position: relative;
z-index: 2;
2020-06-11 19:36:26 +00:00
border-left: 1px dashed;
max-width: ~'calc( (100vw - '@page-width + @margin-side * 4 ~' ) / 2 )';
max-height: ~'calc( 100vh - '@header-height * 2 + @margin-side * 4 ~' )';
2020-06-10 22:02:22 +00:00
overflow: visible auto;
overscroll-behavior: contain;
display: block;
}
}
@media ( max-width: @screen3 ) {
.toc {
z-index: 10;
2020-07-04 02:02:12 +00:00
height: 100%;
2020-06-10 22:02:22 +00:00
margin-top: -@header-height;
padding: 0;
transform: translateX( -100% );
2020-06-10 22:02:22 +00:00
&:before,
&:after {
content: unset; // Disable fade
}
&toggle {
&span {
display: block;
font-size: 0 !important;
}
2020-06-10 22:02:22 +00:00
&label {
2020-06-10 22:02:22 +00:00
position: fixed;
z-index: 7;
right: -100vw;
2020-06-10 22:02:22 +00:00
bottom: 0;
margin: @margin-side;
padding: 0 @margin-side / 2;
width: 39px;
height: 56px;
display: block;
background-color: var( --screen3-toc-toggle-label-background-color );
2020-06-10 22:02:22 +00:00
border-radius: 100%;
.boxshadow(4);
&:hover {
background-color: var( --screen3-toc-toggle-label-hover-background-color );
2020-06-10 22:02:22 +00:00
.boxshadow(5);
&:before {
opacity: @opacity-icon-active;
}
}
&:focus {
background-color: var( --screen3-toc-toggle-label-focus-background-color );
2020-06-10 22:02:22 +00:00
}
&:before {
.resource-loader-icon;
display: block;
opacity: @opacity-icon;
}
}
&checkbox:not( :checked ) ~ ul {
2020-11-23 02:48:42 +00:00
transform: translateX( -300px - @margin-side );
}
2020-06-10 22:02:22 +00:00
}
&title h2 {
display: none;
}
> ul {
display: block !important; // So that animation is visible
margin: 0 !important;
padding: @header-height + @margin-side @margin-side @margin-side * 2 @margin-side / 2 !important; // More scroll spaces
2020-06-11 20:33:35 +00:00
max-width: none;
height: 100%;
2020-06-11 20:06:02 +00:00
max-height: ~'calc( 100vh - '@header-height + @margin-side * 3 ~')';
background: var( --screen3-toc-ul-background-color );
border-radius: 0 @border-radius-large @border-radius-large 0;
.boxshadow(3);
transform: translateX( 100% );
2020-06-10 22:02:22 +00:00
transition: @transition-transform;
}
}
.skin-citizen-dark {
2020-06-10 22:02:22 +00:00
.toc {
&togglelabel {
2020-06-10 22:02:22 +00:00
&:before {
filter: invert( 1 );
}
2020-08-10 03:33:45 +00:00
}
2020-06-10 22:02:22 +00:00
}
}
}