From 9c8fec06d2b58e4e3bbe280ddc665a99fcc4878c Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Sun, 09 Mar 2025 22:33:15 +0000
Subject: [PATCH] feat: support non-singleton search

---
 quartz/components/styles/toc.scss |   42 ++++++++++++++++++++++++++++--------------
 1 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/quartz/components/styles/toc.scss b/quartz/components/styles/toc.scss
index 9c0a4b2..42aa35c 100644
--- a/quartz/components/styles/toc.scss
+++ b/quartz/components/styles/toc.scss
@@ -1,4 +1,23 @@
-button#toc {
+@use "../../styles/variables.scss" as *;
+
+.toc {
+  display: flex;
+  flex-direction: column;
+
+  overflow-y: hidden;
+  flex: 0 1 auto;
+  &:has(button.toc-header.collapsed) {
+    flex: 0 1 1.2rem;
+  }
+}
+
+@media all and not ($mobile) {
+  .toc-header {
+    display: flex;
+  }
+}
+
+button.toc-header {
   background-color: transparent;
   border: none;
   text-align: left;
@@ -15,25 +34,19 @@
   }
 
   & .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.5s ease;
 
-  &.collapsed > .overflow::after {
-    opacity: 0;
-  }
+.toc-content {
+  list-style: none;
+  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;
       }
@@ -55,4 +70,3 @@
     }
   }
 }
-  

--
Gitblit v1.10.0