Feat: Prevent ToC flicker on initial load

Use CSS to control ToC height instead of JavaScript to prevent flickering.
This commit is contained in:
ZhenShuo Leo
2025-05-05 08:30:34 +08:00
parent 6fb8b945d7
commit c59cb293bf
3 changed files with 15 additions and 31 deletions

View File

@@ -1507,8 +1507,8 @@ body.zen-mode-enable {
.overflow-visible {
overflow: visible;
}
.overflow-y-scroll {
overflow-y: scroll;
.overflow-y-auto {
overflow-y: auto;
}
.overscroll-contain {
overscroll-behavior: contain;
@@ -3537,6 +3537,11 @@ body a, body button {
#TableOfContents {
max-width: 25vw;
}
#TOCView {
max-height: calc(100vh - 150px);
min-height: 0;
overflow-x: hidden;
}
.toc ul, .toc li {
list-style-type: none;
padding-inline: calc(var(--spacing) * 0);