Skip to content

Conversation

omegahm
Copy link
Contributor

@omegahm omegahm commented Sep 6, 2024

This sets scroll-margin-top on all h1 through h6 when applied with the element state target. This happens when you click a link and are taking to that anchor (with #).

scroll-margin-top adds a margin of 1rem where it jumps to, adding a bit of space at the top of the page.

Before After
Screenshot 2024-09-06 at 21 44 07 Screenshot 2024-09-06 at 21 43 51

Copy link
Member

@st0012 st0012 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thank you!

@st0012 st0012 added this to the v6.8.0 milestone Oct 17, 2024
@st0012 st0012 merged commit 7398e5b into ruby:master Oct 17, 2024
26 checks passed
matzbot pushed a commit to ruby/ruby that referenced this pull request Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants