Files
halo_theme_terminal/src/styles/toc.scss
T

142 lines
3.1 KiB
SCSS

.toc {
position: fixed;
top: 20vh;
z-index: 1000;
display: none;
padding-top: calc(var(--size-theme-font) * 2.5);
&:not(.toc-visible) {
width: calc(var(--size-theme-font) * 2);
height: calc(var(--size-theme-font) * 2);
padding: 0;
background: transparent;
border: none;
}
&.toc-visible {
width: calc(var(--size-theme-font) * 17.5);
max-width: calc(100vw - var(--size-theme-font) * 2.5);
height: auto;
max-height: calc(80vh - var(--size-theme-font) * 2);
padding: calc(var(--size-theme-font) * 2.5) calc(var(--size-theme-font) * 0.75) calc(var(--size-theme-font) * 0.75);
background: var(--color-theme-background);
.toc-content {
max-height: calc(80vh - var(--size-theme-font) * 7);
}
}
.toc-content {
display: none;
overflow-y: auto;
&::-webkit-scrollbar {
width: calc(var(--size-theme-font) * 0.375);
}
&::-webkit-scrollbar-track {
background: transparent;
}
&::-webkit-scrollbar-thumb {
background: var(--color-theme-foreground);
&:hover {
background: transparent;
}
}
}
&.toc-visible .toc-content {
display: block;
}
.toc-list {
list-style: none;
padding: 0;
margin: 0;
}
.toc-list-item {
margin: calc(var(--size-theme-font) * 0.25) 0;
.toc-list {
margin-left: var(--size-theme-font);
border-left: calc(var(--size-theme-font) * 0.0625) solid var(--color-theme-foreground);
padding-left: calc(var(--size-theme-font) * 0.5);
}
}
.toc-link {
display: block;
padding: calc(var(--size-theme-font) * 0.25) calc(var(--size-theme-font) * 0.5);
text-decoration: none;
color: var(--color-theme-foreground);
font-size: calc(var(--size-theme-font) * 0.875);
&:hover {
background: transparent;
color: var(--color-theme-accent);
}
&.is-active-link,
.is-active-li > & {
background: transparent;
color: var(--color-theme-accent);
font-weight: bold;
}
}
}
.toc-toggle {
position: absolute;
top: 0;
left: 0;
width: calc(var(--size-theme-font) * 2);
height: calc(var(--size-theme-font) * 2);
padding: 0;
display: flex;
align-items: center;
justify-content: center;
outline: none;
background: transparent;
border: none;
color: var(--color-theme-foreground);
cursor: pointer;
font-size: var(--size-theme-font);
z-index: 1002;
-webkit-tap-highlight-color: transparent;
&:hover {
background: transparent;
-webkit-tap-highlight-color: transparent;
}
}
@media (max-width: 1400px) {
.toc.toc-visible {
border: calc(var(--size-theme-font) * 0.0625) solid var(--color-theme-foreground);
}
}
@media (max-width: 480px) {
.toc.toc-visible {
max-height: 60vh;
.toc-content {
max-height: calc(60vh - var(--size-theme-font) * 4);
}
.toc-list {
}
.toc-list-item {
margin: calc(var(--size-theme-font) * 0.125) 0;
}
.toc-link {
font-size: calc(var(--size-theme-font) * 0.70);
padding: calc(var(--size-theme-font) * 0.1) calc(var(--size-theme-font) * 0.1);
}
}
}