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

Add scroll-margin-top on all :target elements #1174

Merged
merged 2 commits into from
Oct 17, 2024

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
Development

Successfully merging this pull request may close these issues.

2 participants