From 061567748e0f4155697dd688fa34ffb6ea0dde17 Mon Sep 17 00:00:00 2001 From: SkyzcYou Date: Thu, 19 Dec 2024 20:12:34 +0800 Subject: [PATCH] Fix: Resolve the issue of anchor link positioning not being offset Close: #227 --- src/main.ts | 5 +---- src/styles/main.scss | 5 +++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.ts b/src/main.ts index c405cb7..107971e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -49,10 +49,7 @@ export function generateToc() { "group flex items-center justify-between rounded py-1 px-1.5 transition-all hover:bg-gray-100 text-sm opacity-80 dark:hover:bg-slate-700 dark:text-slate-50", collapseDepth: 6, headingsOffset: 100, - scrollSmooth: true, - scrollSmoothOffset: -100, - // @ts-ignore - tocScrollOffset: 50, + scrollSmooth: false, }); } diff --git a/src/styles/main.scss b/src/styles/main.scss index 70b81d0..914256d 100644 --- a/src/styles/main.scss +++ b/src/styles/main.scss @@ -2,6 +2,11 @@ body { overflow: overlay; } +html { + scroll-padding-top: 100px; + scroll-behavior: smooth; +} + *::-webkit-scrollbar-track-piece { background-color: #f8f8f8; -webkit-border-radius: 2em;