From e3ded78ba3992049ea3809d0f4d0152051ba7390 Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Fri, 1 Sep 2023 19:30:15 -0500 Subject: [PATCH] make toc look better --- src/components/TocWrapper.astro | 3 ++- src/styles/global.scss | 1 + src/styles/post.scss | 1 + src/styles/toc.scss | 3 ++- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/TocWrapper.astro b/src/components/TocWrapper.astro index fa292c0..9f7c9a0 100644 --- a/src/components/TocWrapper.astro +++ b/src/components/TocWrapper.astro @@ -8,6 +8,7 @@ interface Props { } const { toc, headings } = Astro.props; +const minDepth = Math.min(...headings.map((heading) => heading.depth)); --- { @@ -20,7 +21,7 @@ const { toc, headings } = Astro.props;