From c538c151c7462ad0395ff2c15c5e11e89e362aa8 Mon Sep 17 00:00:00 2001
From: Striven <sg.striven@cutecat.club>
Date: Sat, 04 Apr 2026 19:47:16 +0000
Subject: [PATCH] Initial commit

---
 quartz/components/styles/toc.scss |   54 +++++++++++++++++++++++++++++++++---------------------
 1 files changed, 33 insertions(+), 21 deletions(-)

diff --git a/quartz/components/styles/toc.scss b/quartz/components/styles/toc.scss
index eee3ee8..6a7723b 100644
--- a/quartz/components/styles/toc.scss
+++ b/quartz/components/styles/toc.scss
@@ -1,4 +1,17 @@
-button#toc {
+@use "../../styles/variables.scss" as *;
+
+.toc {
+  display: flex;
+  flex-direction: column;
+  overflow-y: hidden;
+  min-height: 1.4rem;
+  flex: 0 0.5 auto;
+  &:has(button.toc-header.collapsed) {
+    flex: 0 1 1.4rem;
+  }
+}
+
+button.toc-header {
   background-color: transparent;
   border: none;
   text-align: left;
@@ -15,33 +28,33 @@
   }
 
   & .fold {
-    margin-left: 0.5rem; 
+    margin-left: 0.5rem;
     transition: transform 0.3s ease;
     opacity: 0.8;
   }
 
   &.collapsed .fold {
-    transform: rotateZ(-90deg)
+    transform: rotateZ(-90deg);
   }
 }
-  
-#toc-content {
-  list-style: none;
-  overflow: hidden;
-  max-height: none;
-  transition: max-height 0.3s ease;
 
-  & ul {
-    list-style: none;
-    margin: 0.5rem 0;
-    padding: 0;
-    & > li > a {
-      color: var(--dark);
-      opacity: 0.35;
-      transition: 0.5s ease opacity, 0.3s ease color;
-      &.in-view {
-        opacity: 0.75;
-      }
+ul.toc-content.overflow {
+  list-style: none;
+  position: relative;
+  margin: 0.5rem 0;
+  padding: 0;
+  max-height: calc(100% - 2rem);
+  overscroll-behavior: contain;
+  list-style: none;
+
+  & > li > a {
+    color: var(--dark);
+    opacity: 0.35;
+    transition:
+      0.5s ease opacity,
+      0.3s ease color;
+    &.in-view {
+      opacity: 0.75;
     }
   }
 
@@ -51,4 +64,3 @@
     }
   }
 }
-  

--
Gitblit v1.10.0