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 |   60 +++++++++++++++++++++---------------------------------------
 1 files changed, 21 insertions(+), 39 deletions(-)

diff --git a/quartz/components/styles/toc.scss b/quartz/components/styles/toc.scss
index 512b01d..6a7723b 100644
--- a/quartz/components/styles/toc.scss
+++ b/quartz/components/styles/toc.scss
@@ -1,13 +1,17 @@
+@use "../../styles/variables.scss" as *;
+
 .toc {
   display: flex;
   flex-direction: column;
-  &.desktop-only {
-    display: flex;
-    max-height: 40%;
+  overflow-y: hidden;
+  min-height: 1.4rem;
+  flex: 0 0.5 auto;
+  &:has(button.toc-header.collapsed) {
+    flex: 0 1 1.4rem;
   }
 }
 
-button#toc {
+button.toc-header {
   background-color: transparent;
   border: none;
   text-align: left;
@@ -34,47 +38,25 @@
   }
 }
 
-#toc-content {
+ul.toc-content.overflow {
   list-style: none;
-  overflow: hidden;
-  overflow-y: auto;
-  max-height: 100%;
-  transition:
-    max-height 0.35s ease,
-    visibility 0s linear 0s;
   position: relative;
-  visibility: visible;
+  margin: 0.5rem 0;
+  padding: 0;
+  max-height: calc(100% - 2rem);
+  overscroll-behavior: contain;
+  list-style: none;
 
-  &.collapsed {
-    max-height: 0;
+  & > li > a {
+    color: var(--dark);
+    opacity: 0.35;
     transition:
-      max-height 0.35s ease,
-      visibility 0s linear 0.35s;
-    visibility: hidden;
-  }
-
-  &.collapsed > .overflow::after {
-    opacity: 0;
-  }
-
-  & 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;
-      }
+      0.5s ease opacity,
+      0.3s ease color;
+    &.in-view {
+      opacity: 0.75;
     }
   }
-  > ul.overflow {
-    max-height: none;
-  }
 
   @for $i from 0 through 6 {
     & .depth-#{$i} {

--
Gitblit v1.10.0