Skip to content

Commit 2689666

Browse files
tanishqmanujasatnaing
authored andcommitted
fix: add scroll offset for anchor targets (satnaing#506)
* fix: add scroll offset for anchor targets * fix: update scroll-margin-block to 1rem --------- Co-authored-by: satnaing <satnaingdev@gmail.com> (cherry picked from commit ae80e99)
1 parent fd2b56a commit 2689666

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/styles/global.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,9 @@ html[data-theme="dark"] {
6868
.active-nav {
6969
@apply underline decoration-wavy decoration-2 underline-offset-4;
7070
}
71+
72+
/* Source: https://piccalil.li/blog/a-more-modern-css-reset/ */
73+
/* Anything that has been anchored to should have extra scroll margin */
74+
:target {
75+
scroll-margin-block: 1rem;
76+
}

0 commit comments

Comments
 (0)