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

Use <hr> instead of border-top in Migration headings #1907

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

doup
Copy link
Contributor

@doup doup commented Dec 5, 2024

Fixes a minor detail 😅. Right now Migration guides H3 headings have the border-top set. The problem is that when the user clicks on the sidebar links (or #) the scrolls aligns with the horizontal line because that's part of the heading.

The solution is to remove the border-top from the H3 heading and use <hr> instead, this way the scroll aligns with the text instead of the horizontal line.

Demo:

  • First old behaviour
  • Then this PR behaviour
migrations-extract-heading-hr.mp4

Copy link
Contributor

@rparrett rparrett left a comment

Choose a reason for hiding this comment

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

Do we not have a GH issue documenting the known wonkiness of the sidebar?

( video over here: https://discord.com/channels/691052431525675048/695741366520512563/1298740373102792726 )

Anyhow, still seeing that issue on my end (chrome/macos), but I like this little detail.

@doup
Copy link
Contributor Author

doup commented Dec 5, 2024

I saw that mentioned in Discord… but no idea if there is an GH issue.

I just checked, and it's working fine, but since we have a fixed header it feels weird (?). It probably gets fixed if we change the top part in rootMargin in the intersection observer. Probably needs the header height and that's it, which can be accessed with getComputedStyle(document.body).getPropertyValue('--header-height').

wonky-sidebar.mp4

@rparrett
Copy link
Contributor

rparrett commented Dec 5, 2024

Cool, thanks for looking into that. Documented in separate issue.

@rparrett rparrett added C-Bug A problem with the code that runs the site C-Webdev A-Migration Guides D-Trivial labels Dec 9, 2024
@rparrett rparrett added the S-Ready-For-Final-Review Ready for a maintainer to consider for merging label Dec 10, 2024
@cart cart added this pull request to the merge queue Dec 10, 2024
Merged via the queue into bevyengine:main with commit a13c109 Dec 10, 2024
10 checks passed
@doup doup deleted the fix-migration-heading-anchor branch December 10, 2024 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Migration Guides C-Bug A problem with the code that runs the site C-Webdev D-Trivial S-Ready-For-Final-Review Ready for a maintainer to consider for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants