hugo-theme-zzo/assets/sass/components/_toc.scss

243 lines
5.1 KiB
SCSS
Raw Normal View History

2019-11-04 13:09:44 +00:00
.toc {
width: 100%;
max-width: $sidebar-width;
2019-11-04 13:09:44 +00:00
position: fixed;
top: 7rem;
2019-11-04 13:09:44 +00:00
font-size: 0.85rem;
padding-left: 0.5rem;
z-index: z('toc');
@include no-select;
@include animation('slide-in-down-little .2s .3s 1 ease-in backwards');
2019-11-04 13:09:44 +00:00
2020-01-01 11:00:42 +00:00
#TableOfContents {
2019-11-04 13:09:44 +00:00
position: relative;
}
&__flexbox[data-position="fixed"] {
@include flexbox();
@include align-items(center);
position: fixed;
.toc__title {
margin-top: 0.75rem;
margin-left: 0.5rem;
}
}
&__flexbox[data-position="absolute"] {
@include flexbox();
@include align-items(center);
position: absolute;
}
&__flexbox--outer[data-position="fixed"] {
@include flexbox();
@include align-items(center);
top: 4.2rem;
left: 1rem;
position: absolute;
2020-01-22 11:49:53 +00:00
@include animation('slide-in-down-little .2s .3s 1 ease-in backwards');
@media only screen and (max-width: 1300px) {
display: none;
}
}
&__flexbox--outer[data-dir="ltr"] {
top: 4.2rem;
left: 1rem;
}
&__flexbox--outer[data-dir="rtl"] {
top: 4.2rem;
right: 1rem;
.toc__title {
margin-top: 0.75rem;
margin-left: 0.5rem;
}
}
2019-11-04 13:09:44 +00:00
&__title {
font-size: 0.9rem;
margin-top: 0.5rem;
2020-01-22 09:40:24 +00:00
@include animation('slide-in-down-little .2s .3s 1 ease-in backwards');
2019-11-04 13:09:44 +00:00
@include themify($themes) {
color: themed('toc-label-color');
}
2020-01-22 09:40:24 +00:00
2020-01-22 12:14:40 +00:00
&--outer {
@media only screen and (max-width: 1300px) {
display: none;
}
2020-01-22 09:40:24 +00:00
}
2019-11-04 13:09:44 +00:00
}
&[data-dir="ltr"] {
2020-01-31 06:06:30 +00:00
&[data-folding=true] {
@include themify($themes) {
a {
color: themed('toc-vertical-line');
position: relative;
&::before {
content: '';
height: 100%;
left: -1rem;
margin-top: -1px;
position: absolute;
width: 2px;
background-color: themed('toc-vertical-line');
&:last-child {
background-color: transparent;
}
}
}
.active {
color: themed('toc-vertical-line-active');
font-weight: 700;
&::before {
background-color: themed('toc-vertical-line-active');
}
}
}
}
2020-01-31 06:06:30 +00:00
&[data-folding=false] {
@include themify($themes) {
2020-01-31 06:06:30 +00:00
a {
color: themed('toc-vertical-line');
&.active {
color: themed('toc-vertical-line-active');
&::before {
background-color: themed('toc-vertical-line-active');
content: '';
height: 0.95rem;
left: -1rem;
margin-top: 2px;
position: absolute;
width: 2px;
&:last-child {
background-color: transparent;
}
}
}
}
}
}
ul {
@include themify($themes) {
li {
li {
margin-left: 1rem;
color: themed('sidebar-li-color');
}
}
2019-11-04 13:09:44 +00:00
}
}
}
&[data-dir="rtl"] {
2020-01-31 06:06:30 +00:00
&[data-folding=true] {
a {
color: inherit;
position: relative;
&::before {
@include themify($themes) {
background-color: themed('toc-vertical-line');
}
content: '';
height: 100%;
right: -1rem;
margin-top: -1px;
position: absolute;
width: 2px;
&:last-child {
background-color: transparent;
}
}
}
2020-01-31 06:06:30 +00:00
.active {
@include themify($themes) {
color: themed('link-hover');
font-weight: 700;
&::before {
background-color: themed('toc-vertical-line-active');
}
}
}
}
&[data-folding=false] {
@include themify($themes) {
a {
color: themed('toc-vertical-line');
&.active {
color: themed('toc-vertical-line-active');
&::before {
background-color: themed('toc-vertical-line-active');
content: '';
height: 0.95rem;
right: -1rem;
margin-top: 2px;
position: absolute;
width: 2px;
&:last-child {
background-color: transparent;
}
}
}
}
}
}
2020-01-31 06:06:30 +00:00
ul {
@include themify($themes) {
2020-01-31 06:06:30 +00:00
li {
li {
margin-right: 1rem;
color: themed('sidebar-li-color');
}
}
}
}
2019-11-04 13:09:44 +00:00
}
ul {
@include themify($themes) {
a {
color: themed('toc-title-color');
&.active {
color: themed('toc-vertical-line-active');
}
2019-11-04 13:09:44 +00:00
}
}
}
&__outer {
padding-right: 1rem;
padding-left: 2.5rem;
max-width: calc((100vw - 980px) / 2);
@media only screen and (max-width: 1300px) {
display: none;
}
}
2019-11-04 13:09:44 +00:00
}
.expand__content {
#TableOfContents {
ul {
list-style-type: circle;
}
}
}