Skip to content

Commit ae80e99

Browse files
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 <[email protected]>
1 parent 852d3b8 commit ae80e99

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/styles/global.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,9 @@ html[data-theme="dark"] {
5757
.active-nav {
5858
@apply underline decoration-wavy decoration-2 underline-offset-4;
5959
}
60+
61+
/* Source: https://piccalil.li/blog/a-more-modern-css-reset/ */
62+
/* Anything that has been anchored to should have extra scroll margin */
63+
:target {
64+
scroll-margin-block: 1rem;
65+
}

0 commit comments

Comments
 (0)