From 4e4930ef9c2e2ddb9bcb1436660d3a3002c19844 Mon Sep 17 00:00:00 2001
From: Anton Bulakh <him@necauq.ua>
Date: Fri, 24 Jan 2025 03:19:46 +0000
Subject: [PATCH] chore(styles): omit sass deprecation warnings (#1737)
---
quartz/components/styles/toc.scss | 53 ++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 46 insertions(+), 7 deletions(-)
diff --git a/quartz/components/styles/toc.scss b/quartz/components/styles/toc.scss
index 1f1a27b..4988cd8 100644
--- a/quartz/components/styles/toc.scss
+++ b/quartz/components/styles/toc.scss
@@ -1,3 +1,20 @@
+@use "../../styles/variables.scss" as *;
+
+.toc {
+ display: flex;
+ flex-direction: column;
+
+ &.desktop-only {
+ max-height: 40%;
+ }
+}
+
+@media all and not ($mobile) {
+ .toc {
+ display: flex;
+ }
+}
+
button#toc {
background-color: transparent;
border: none;
@@ -15,21 +32,38 @@
}
& .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.3s ease;
+ overflow-y: auto;
+ max-height: 100%;
+ transition:
+ max-height 0.35s ease,
+ visibility 0s linear 0s;
+ position: relative;
+ visibility: visible;
+
+ &.collapsed {
+ max-height: 0;
+ transition:
+ max-height 0.35s ease,
+ visibility 0s linear 0.35s;
+ visibility: hidden;
+ }
+
+ &.collapsed > .overflow::after {
+ opacity: 0;
+ }
& ul {
list-style: none;
@@ -38,12 +72,18 @@
& > li > a {
color: var(--dark);
opacity: 0.35;
- transition: 0.5s ease opacity;
+ transition:
+ 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} {
@@ -51,4 +91,3 @@
}
}
}
-
--
Gitblit v1.10.0