-
Notifications
You must be signed in to change notification settings - Fork 24
Fix mobile hamburger menu positioning and slide animation direction #724
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
Conversation
|
@ccamel 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs. I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Remove problematic transform from navbar-sidebar CSS that was causing the mobile menu to be positioned outside the viewport. The custom transform: translate3d(100%, 0, 0) was preventing the sidebar from being visible when opened on mobile devices. Co-authored-by: ccamel <9574336+ccamel@users.noreply.github.com>
|
@copilot Looks good and the menu shows up now 👍 But, AFAIS right now it slides in from the left, which feels off since the burger is on the right. UX-wise we can't ship it like this though, the menu needs to slide in from the right, not the left. Can you adjust the hidden state/transform so it behaves accordingly? |
Adjust CSS to make mobile menu slide in from the right instead of left, providing better UX since the hamburger button is positioned on the right side. The menu now properly slides from the right edge of the screen when opened. Co-authored-by: ccamel <9574336+ccamel@users.noreply.github.com>
Fixed! The mobile menu now slides in from the right side as expected, matching the hamburger button position. The CSS has been updated to use Changes in commit 800345a. |
ccamel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent! Thanks ❤️
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
bot-anik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Device | URL |
|---|---|
| desktop | http://localhost:3000/ |
| Device | URL |
|---|---|
| mobile | http://localhost:3000/ |
Not what you expected? Are your scores flaky? GitHub runners could be the cause.
Try running on Foo instead

The mobile hamburger menu was not functioning properly on mobile devices because the navigation sidebar was positioned outside the viewport due to incorrect CSS transform values. Additionally, the menu was sliding in from the wrong direction, creating a poor user experience.
Problem
When users clicked the hamburger menu button (☰) on mobile devices, the menu appeared to do nothing. Upon investigation, the sidebar was actually being rendered but positioned completely off-screen to the right of the viewport, making it invisible to users. After fixing the initial positioning issue, the menu was sliding in from the left, which felt unnatural since the hamburger button is positioned on the right side.
Root Cause
The issue was in
src/scss/main.scsswhere the.navbar-sidebarhad a CSS transform that positioned it 100% to the right:This transform was interfering with Docusaurus's built-in mobile navigation positioning and animation system.
Solution
Updated the CSS to properly handle both the hidden and visible states of the mobile menu:
transform: translate3d(100%, 0, 0)transform: translate3d(0, 0, 0)when.navbar-sidebar--showclass is appliedThis creates a natural slide-in animation from the right side, matching the hamburger button position.
Testing
The mobile hamburger menu now works as expected with improved UX across all mobile devices!
Fixes #710.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.