Skip to content

Fix sidebar animation and other behavior #2750

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

Merged
merged 1 commit into from
Jul 14, 2025

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Jul 14, 2025

This fixes several issues with how the sidebar was behaving:

  • Manually resizing the sidebar was incorrectly applying transition animations to the page-wrapper causing awkward movement.
  • Clicking the sidebar toggle caused the menu bar to behave differently compared to loading a page with the sidebar visible or hidden.
  • page-wrapper animation wasn't working when JS was disabled.
  • RTL sidebar animation was broken.

Most of these issues stem from
#2454 which moved js and sidebar-visible classes from <body> to <html>, but failed to update some of the JS and CSS code that was still assuming it was on the body.

#1641 previously moved js from <html> to <body> with the reasoning
"This will be necessary for using CSS selectors on root attributes.". However, I don't see how that is absolutely necessary, since selectors like [dir=rtl].js should work to select the root element. I might be missing something here, but I think everything looks to be working.

Fixes #2697
Fixes #2642

This fixes several issues with how the sidebar was behaving:

- Manually resizing the sidebar was incorrectly applying transition
  animations to the page-wrapper causing awkward movement.
- Clicking the sidebar toggle caused the menu bar to behave differently
  compared to loading a page with the sidebar visible or hidden.
- page-wrapper animation wasn't working when JS was disabled.
- RTL sidebar animation was broken.

Most of these issues stem from
rust-lang#2454 which moved `js` and
`sidebar-visible` classes from `<body>` to `<html>`, but failed to
update some of the JS and CSS code that was still assuming it was on the
body.

rust-lang#1641 previously moved `js` from
`<html>` to `<body>` with the reasoning
"This will be necessary for using CSS selectors on root attributes.".
However, I don't see how that is absolutely necessary, since selectors
like `[dir=rtl].js` should work to select the root element.
@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label Jul 14, 2025
@ehuss ehuss added this pull request to the merge queue Jul 14, 2025
Merged via the queue into rust-lang:master with commit 1eeb0d2 Jul 14, 2025
14 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: waiting on a review label Jul 14, 2025
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.

Sidebar overlaps with a menu-bar Sidebar State Affects Auto-Hiding Behavior of Menu Bar
2 participants