style: adjust toc style

This commit is contained in:
Erzbir
2025-08-04 11:44:15 +08:00
parent 1d45f00fda
commit 7d63249b1e
+20 -19
View File
@@ -1,11 +1,5 @@
$toc-bg: color-mix(in srgb, var(--color-theme-background) 70%, transparent);
$toc-border: 1px solid var(--color-theme-foreground);
.toc { .toc {
margin-left: 12px; margin-left: 12px;
max-height: 60vh;
background: $toc-bg;
border: $toc-border;
position: fixed; position: fixed;
display: block; display: block;
z-index: 1000; z-index: 1000;
@@ -13,6 +7,7 @@ $toc-border: 1px solid var(--color-theme-foreground);
padding: 40px 12px 12px; padding: 40px 12px 12px;
.toc-content { .toc-content {
overflow: auto;
display: none; display: none;
} }
@@ -32,7 +27,7 @@ $toc-border: 1px solid var(--color-theme-foreground);
background: var(--color-theme-foreground); background: var(--color-theme-foreground);
&:hover { &:hover {
background: var(--color-theme-background); background: transparent;
} }
} }
@@ -40,6 +35,7 @@ $toc-border: 1px solid var(--color-theme-foreground);
list-style: none; list-style: none;
padding: 0; padding: 0;
margin: 0; margin: 0;
max-height: calc(100vh - 120px);
} }
.toc-list-item { .toc-list-item {
@@ -47,7 +43,7 @@ $toc-border: 1px solid var(--color-theme-foreground);
.toc-list { .toc-list {
margin-left: 16px; margin-left: 16px;
border-left: $toc-border; border-left: 1px solid var(--color-theme-foreground);
padding-left: 8px; padding-left: 8px;
} }
} }
@@ -99,15 +95,16 @@ $toc-border: 1px solid var(--color-theme-foreground);
align-items: center; align-items: center;
justify-content: center; justify-content: center;
outline: none; outline: none;
background: inherit; background: transparent;
border: $toc-border; border: none;
color: var(--color-theme-foreground); color: var(--color-theme-foreground);
cursor: pointer; cursor: pointer;
font-size: 16px; font-size: 16px;
z-index: 1002; z-index: 1002;
&:hover { &:hover {
background: inherit; background: transparent;
-webkit-tap-highlight-color: transparent;
} }
} }
@@ -116,9 +113,7 @@ $toc-border: 1px solid var(--color-theme-foreground);
width: 32px; width: 32px;
height: 32px; height: 32px;
padding: 0; padding: 0;
background: $toc-bg;
border: none; border: none;
max-height: none;
overflow: visible; overflow: visible;
left: calc(100vw - 52px); left: calc(100vw - 52px);
@@ -130,12 +125,10 @@ $toc-border: 1px solid var(--color-theme-foreground);
width: 280px; width: 280px;
max-width: calc(100vw - 20px); max-width: calc(100vw - 20px);
height: auto; height: auto;
max-height: calc(100vh - 40px); max-height: calc(100vh - 80px);
padding: 40px 12px 12px; padding: 40px 12px 12px;
background: $toc-bg; background: var(--color-theme-background);
border: $toc-border; border: 1px solid var(--color-theme-foreground);
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
overflow-y: auto;
z-index: 1001; z-index: 1001;
&.toc-overflow-right { &.toc-overflow-right {
@@ -146,6 +139,10 @@ $toc-border: 1px solid var(--color-theme-foreground);
.toc-content { .toc-content {
display: block; display: block;
} }
.toc-list {
max-height: calc(100vh - 120px);
}
} }
.toc-link { .toc-link {
@@ -163,5 +160,9 @@ $toc-border: 1px solid var(--color-theme-foreground);
.toc.toc-visible { .toc.toc-visible {
width: calc(100vw - 200px); width: calc(100vw - 200px);
max-height: 60vh; max-height: 60vh;
.toc-list {
max-height: calc(60vh - 60px);
}
} }
} }