From f70e562432ca251d4c4373dfa0b02dcde11297bc Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Mon, 31 Mar 2025 00:30:01 +0000
Subject: [PATCH] fix: overflow list bottom gradient on toc (closes #1888)

---
 quartz/components/styles/toc.scss |   58 ++++++++++++++++++----------------------------------------
 1 files changed, 18 insertions(+), 40 deletions(-)

diff --git a/quartz/components/styles/toc.scss b/quartz/components/styles/toc.scss
index 4988cd8..efa0aa7 100644
--- a/quartz/components/styles/toc.scss
+++ b/quartz/components/styles/toc.scss
@@ -4,18 +4,21 @@
   display: flex;
   flex-direction: column;
 
-  &.desktop-only {
-    max-height: 40%;
+  overflow-y: hidden;
+  min-height: 4rem;
+  flex: 0 1 auto;
+  &:has(button.toc-header.collapsed) {
+    flex: 0 1 1.2rem;
   }
 }
 
 @media all and not ($mobile) {
-  .toc {
+  .toc-header {
     display: flex;
   }
 }
 
-button#toc {
+button.toc-header {
   background-color: transparent;
   border: none;
   text-align: left;
@@ -42,48 +45,23 @@
   }
 }
 
-#toc-content {
+ul.toc-content {
   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;
 
-  &.collapsed {
-    max-height: 0;
+  list-style: none;
+  & > 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;
-    width: 100%;
-  }
 
   @for $i from 0 through 6 {
     & .depth-#{$i} {

--
Gitblit v1.10.0