Skip to content
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

Urls with ids end up with target out of view #1198

Closed
Nashenas88 opened this issue Apr 21, 2020 · 3 comments · Fixed by #1463
Closed

Urls with ids end up with target out of view #1198

Nashenas88 opened this issue Apr 21, 2020 · 3 comments · Fixed by #1463
Labels
A-Style Area: Style (CSS, etc.)

Comments

@Nashenas88
Copy link

An example of this can be seen here: https://rustc-dev-guide.rust-lang.org/appendix/glossary.html#nll

Regardless of whether you're in desktop or mobile, the nll item it just out of view. This seems to be related to how the sticky header is implemented.

@Nashenas88
Copy link
Author

I've got a prototype in place at https://jsfiddle.net/q7pbjdxc/12/ that might also fix #1102.

@mgeier
Copy link

mgeier commented Apr 21, 2020

You could also try scroll-margin-top: var(--header-height); on the target element.

https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-margin-top

Does need a special case for Safari though, and doesn't work on Internet Explorer (who cares!):
https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-margin-top#Browser_compatibility

@ehuss ehuss added the A-Style Area: Style (CSS, etc.) label Apr 22, 2020
@Nashenas88
Copy link
Author

This was the most recent iteration: https://jsfiddle.net/q7pbjdxc/17/.

I haven't worked on this much since then. I lost my motivation to continue this, but hopefully what I've done so far is a good starting point for someone else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Style Area: Style (CSS, etc.)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants