feat: add scroll-margin-top for headings to improve anchor offset behavior

This commit is contained in:
interlope committed 2026-06-02 00:20:52 +02:00
1 parent 58c19267e7
commit 16d2ad0ae2
1 file changed
+14
+14
View File
@@ -1751,6 +1751,20 @@ pre code.hljs {
background: transparent !important;
}
/* ========================================
ANCHOR OFFSET — clear the fixed navbar on ToC / hash jumps
Without this, jumping to a heading lands it at y=0, hidden behind the
fixed-top navbar. scroll-margin-top stops the jump below the bar.
======================================== */
.content h1,
.content h2,
.content h3,
.content h4,
.content h5,
.content h6 {
scroll-margin-top: 5rem;
}
/* ========================================
KEYBOARD FOCUS — visible ring for keyboard users only
======================================== */