From bb24cd13c7fafbd42d3980c45351a58a76dabb18 Mon Sep 17 00:00:00 2001
From: 1 gal Rosemary <cerasusyedoensis@proton.me>
Date: Sat, 05 Apr 2025 17:39:28 +0000
Subject: [PATCH] fix(css): styles issues with popover, overflow, and scroll overflow (#1907)
---
quartz/components/styles/toc.scss | 88 ++++++++++++++++++++++++++++++-------------
1 files changed, 61 insertions(+), 27 deletions(-)
diff --git a/quartz/components/styles/toc.scss b/quartz/components/styles/toc.scss
index 3003f40..bf1bc22 100644
--- a/quartz/components/styles/toc.scss
+++ b/quartz/components/styles/toc.scss
@@ -1,33 +1,67 @@
-details.toc {
- & summary {
- cursor: pointer;
+@use "../../styles/variables.scss" as *;
- list-style: none;
- &::marker, &::-webkit-details-marker {
- display: none;
- }
+.toc {
+ display: flex;
+ flex-direction: column;
- & > * {
- display: inline-block;
- margin: 0;
- }
-
- & > h3 {
- font-size: 1rem;
- }
+ overflow-y: hidden;
+ min-height: 1.2rem;
+ flex: 0 1 auto;
+ &:has(button.toc-header.collapsed) {
+ flex: 0 1 1.2rem;
}
-
- & ul {
- list-style: none;
- margin: 0.5rem 0;
- padding: 0;
- & > li > a {
- color: var(--dark);
- opacity: 0.35;
- transition: 0.5s ease opacity;
- &.in-view {
- opacity: 0.75;
- }
+}
+
+@media all and not ($mobile) {
+ .toc-header {
+ display: flex;
+ }
+}
+
+button.toc-header {
+ background-color: transparent;
+ border: none;
+ text-align: left;
+ cursor: pointer;
+ padding: 0;
+ color: var(--dark);
+ display: flex;
+ align-items: center;
+
+ & h3 {
+ font-size: 1rem;
+ display: inline-block;
+ margin: 0;
+ }
+
+ & .fold {
+ margin-left: 0.5rem;
+ transition: transform 0.3s ease;
+ opacity: 0.8;
+ }
+
+ &.collapsed .fold {
+ transform: rotateZ(-90deg);
+ }
+}
+
+ul.toc-content {
+ list-style: none;
+ position: relative;
+ margin: 0.5rem 0;
+ padding: 0;
+ height: 5rem;
+ 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;
}
}
--
Gitblit v1.10.0