-
Notifications
You must be signed in to change notification settings - Fork 588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make anchors have top-padding #2202
Conversation
This padding makes it so that a clicked anchor is visible underneath the top sticky nav.
@JarnoNijboer @florianbader is it? |
Looks good to me. |
Me also, an increase to 70px would make it perfect |
Co-Authored-By: baronfel <[email protected]>
Instead of padding, margin could be used to create space above the text but below the upper section content? Or the z-indexof anchors could be set lower than the x index of the page content so that the page content would remain selectable in this situation? |
Margin doesn't work unfortunately. We could however fix it with some js: Below should work, it's untested (function() {
if (document.location.hash) {
document.body.scrollBy(0, 70);
}
}()); |
Using the following on the anchor works for me, but we would need to create the anchor separate from the header link. I can create a PR for that later if someone isn't faster.
|
Delete comment with the |
This one works for me: inspired by @florianbader solution, i've used Corresponding PR: #2209 .content .anchor::before {
display: block;
content: "";
height: 50px; /* Fixed menu height */
margin: -50px 0 0;
visibility: hidden;
} |
This padding makes it so that a clicked anchor is visible underneath the top sticky nav. I am not at all sure that this is the correct way to handle this situation.
Description
TODO
.content .anchor
s?