From 6dd1780925f262640a65ba99e31e92bc3da043da Mon Sep 17 00:00:00 2001 From: DrMint <29893320+DrMint@users.noreply.github.com> Date: Sun, 10 Mar 2024 14:54:54 +0100 Subject: [PATCH] Only smooth scrolling when clicking on toc --- src/components/AppLayout/components/Html.astro | 1 - .../components/TableOfContentItem.astro | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/components/AppLayout/components/Html.astro b/src/components/AppLayout/components/Html.astro index 31fd21f..ca0d800 100644 --- a/src/components/AppLayout/components/Html.astro +++ b/src/components/AppLayout/components/Html.astro @@ -519,7 +519,6 @@ const { currentTheme } = Astro.locals; } * { - scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--color-base-650) transparent; } diff --git a/src/components/TableOfContent/components/TableOfContentItem.astro b/src/components/TableOfContent/components/TableOfContentItem.astro index cd54a13..8eba736 100644 --- a/src/components/TableOfContent/components/TableOfContentItem.astro +++ b/src/components/TableOfContent/components/TableOfContentItem.astro @@ -11,7 +11,7 @@ const { entry } = Astro.props; {/* ------------------------------------------- HTML ------------------------------------------- */}
  • - {entry.title} + {entry.title} { entry.children.length > 0 && (
      @@ -44,3 +44,19 @@ const { entry } = Astro.props; line-height: 125%; } + +{/* ------------------------------------------- JS --------------------------------------------- */} + +