From 16d2ad0ae232fcb22564fc8ea9f0186f07350f34 Mon Sep 17 00:00:00 2001 From: interlope Date: Tue, 2 Jun 2026 00:20:52 +0200 Subject: [PATCH] feat: add scroll-margin-top for headings to improve anchor offset behavior --- css/style.css | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/css/style.css b/css/style.css index 215bc6e..d093421 100644 --- a/css/style.css +++ b/css/style.css @@ -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 ======================================== */