Bug: Navbar obscuring content after anchor jump
joshuatz opened this issue · comments
Joshua Tzucker commented
This is a regression, due to the refactoring / overhaul of the navbar code. I used to have a bunch of JS to offset the scroll position after an anchor jump (e.g. a click on <a href="#mysection">Link</a>
), to allow space for the navbar. I believe I removed it without replacing it during the refactor.
I think I might have seen something floating around the web on a newer way to tackle this (common) problem with a pure CSS solution (or at least less JS) - something to also look into while fixing.
Joshua Tzucker commented
There is a pure CSS solution that is newer:
html {
/** Or, scroll-padding-top, depending on need */
scroll-margin-top: var(--fixed-nav-height);
}