Skip to content

Conversation

@jimporter
Copy link
Contributor

This patch uses scroll-padding-top to indicate that when the user clicks on an anchor and the browser scrolls to it, the anchor should have that amount of padding on the top, thus neatly accommodating the fixed nav header without any gross hacks!

Note: I used a padding of 70px to match the body's padding, rather than 75px as the old CSS hack used. Probably doesn't matter too much either way, but this seems more consistent...

…solves mkdocs#1931

This patch uses `scroll-padding-top` to indicate that when the user clicks on
an anchor and the browser scrolls to it, the anchor should have that amount of
padding on the top, thus neatly accommodating the fixed nav header without any
gross hacks!
@waylan waylan merged commit a308bdc into mkdocs:master Dec 16, 2019
@jimporter jimporter deleted the scroll-padding branch December 17, 2019 06:19
waylan pushed a commit to mkdocs/mkdocs-bootswatch that referenced this pull request Jan 30, 2020
This patch uses `scroll-padding-top` to indicate that when the user clicks on
an anchor and the browser scrolls to it, the anchor should have that amount of
padding on the top, thus neatly accommodating the fixed nav header without any
gross hacks!
waylan pushed a commit to mkdocs/mkdocs-bootswatch that referenced this pull request Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants