Skip to content

Offset in-page anchor jumps below the fixed navbar#2026

Open
lparsons wants to merge 1 commit into
USRSE:mainfrom
lparsons:fix-navbar-anchor-scroll-offset
Open

Offset in-page anchor jumps below the fixed navbar#2026
lparsons wants to merge 1 commit into
USRSE:mainfrom
lparsons:fix-navbar-anchor-scroll-offset

Conversation

@lparsons

Copy link
Copy Markdown
Member

Description

Adds a scroll-padding-top rule on the html element so that following an in-page anchor link scrolls the target below the fixed (sticky) navbar instead of leaving it hidden behind the navbar. The offset (3.25rem) matches the Bulma fixed-navbar height, and applies to in-page anchor jumps site-wide.

Checklist:

  • I have previewed changes locally or with CircleCI (runs when PR is created)
  • I have completed any content reviews, such as getting input from relevant working groups. If no, please note this and wait to post the PR to the #website channel until the content has been settled.

This is a small style/functionality fix with no content changes.

When you are ready for a technical review/merge, post the for the link for the PR in the US-RSE Slack (#website) to ask for reviewers.

Add scroll-padding-top to the html element so that linking to an
in-page anchor scrolls the target below the sticky navbar instead of
hiding it behind it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@lparsons

Copy link
Copy Markdown
Member Author

@USRSE/usrse-maintainers Please review. This affects the entire site, but seems to work better, at least in my limited testing. Feel free to ignore or provide a better fix though.

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.

1 participant