From 5480269d38ffaff7ffd6576d9a9407430429fb2d Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Sun, 09 Mar 2025 21:58:26 +0000
Subject: [PATCH] perf(explorer): client side explorer (#1810)

---
 quartz/components/styles/toc.scss |   31 +++++++++++++++++++++++--------
 1 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/quartz/components/styles/toc.scss b/quartz/components/styles/toc.scss
index e696864..d1feca6 100644
--- a/quartz/components/styles/toc.scss
+++ b/quartz/components/styles/toc.scss
@@ -1,3 +1,22 @@
+@use "../../styles/variables.scss" as *;
+
+.toc {
+  display: flex;
+  flex-direction: column;
+
+  overflow-y: hidden;
+  flex: 0 1 auto;
+  &:has(button#toc.collapsed) {
+    flex: 0 1 1.2rem;
+  }
+}
+
+@media all and not ($mobile) {
+  .toc {
+    display: flex;
+  }
+}
+
 button#toc {
   background-color: transparent;
   border: none;
@@ -27,13 +46,7 @@
 
 #toc-content {
   list-style: none;
-  overflow: hidden;
-  max-height: none;
-  transition: max-height 0.5s ease;
-
-  &.collapsed > .overflow::after {
-    opacity: 0;
-  }
+  position: relative;
 
   & ul {
     list-style: none;
@@ -42,7 +55,9 @@
     & > li > a {
       color: var(--dark);
       opacity: 0.35;
-      transition: 0.5s ease opacity, 0.3s ease color;
+      transition:
+        0.5s ease opacity,
+        0.3s ease color;
       &.in-view {
         opacity: 0.75;
       }

--
Gitblit v1.10.0