Skip to content

Conversation

@ehuss
Copy link
Contributor

@ehuss ehuss commented Feb 13, 2021

This fixes some issues with how # fragment scrolling works, and how headers are highlighted:

  • h5 and h6 now show a chevron to the side.
  • All :target elements now scroll into view with a top margin so that they aren't covered by the menu bar. This affected anything that wasn't h1-h4 (like h5, h6, footnotes, custom anchors, etc.). I didn't see an obvious reason to restrict this to just header tags, so it now selects all :target elements.

Note that the margin scrolling does not work on Safari, but has been fixed in Technology Preview 117 (which I think is Safari 14.2). This required moving the id from the <a> tag to the header tag, which I think should be fine (Safari didn't seem to like id's on <a> tags).

Fixes #1198
Fixes #1357

@ehuss ehuss merged commit c83bbd6 into rust-lang:master Feb 22, 2021
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.

Footnotes don't have scroll-margin-top style applied Urls with ids end up with target out of view

1 participant