Skip to content

Commit 4045e7c

Browse files
committed
Fix anchor link visibility under sticky navbar
- Add scroll-padding-top to html to offset navbar height - Add scroll-margin-top to article headings for smoother anchor scrolling - Prevents headings from being hidden under sticky navbar when navigating via TOC or hash links
1 parent c446a55 commit 4045e7c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

assets/css/custom.scss

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Ensure anchor-linked headings remain visible under sticky navbar
2+
html {
3+
scroll-padding-top: 80px;
4+
}
5+
16
a, .btn {
27
transition: all 0.2s ease-in-out;
38
}
@@ -116,7 +121,8 @@ blockquote {
116121
h5,
117122
h6 {
118123
-webkit-font-smoothing: antialiased;
119-
font-family: $font-mktg
124+
font-family: $font-mktg;
125+
scroll-margin-top: 80px;
120126
}
121127

122128
h1 { @include h0-mktg }

0 commit comments

Comments
 (0)