From ae80e995a5ccb90a95b0e1b1531ec6f0f12d3a01 Mon Sep 17 00:00:00 2001 From: Tanishq Manuja Date: Sat, 7 Jun 2025 16:00:15 +0530 Subject: [PATCH] fix: add scroll offset for anchor targets (#506) * fix: add scroll offset for anchor targets * fix: update scroll-margin-block to 1rem --------- Co-authored-by: satnaing --- src/styles/global.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/styles/global.css b/src/styles/global.css index 6d15e90..99077b1 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -57,3 +57,9 @@ html[data-theme="dark"] { .active-nav { @apply underline decoration-wavy decoration-2 underline-offset-4; } + +/* Source: https://piccalil.li/blog/a-more-modern-css-reset/ */ +/* Anything that has been anchored to should have extra scroll margin */ +:target { + scroll-margin-block: 1rem; +}