-
Notifications
You must be signed in to change notification settings - Fork 15k
fix(navbar): center logo on mobile (fix hamburger offset) #52382
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
base: main
Are you sure you want to change the base?
Conversation
|
Welcome @ritorhymes! |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
✅ Pull request preview available for checkingBuilt without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Cool. I don't know if you'd be interested in tackling #22021 as well, some time? |
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.
At some viewport sizes, this doesn't look right. Here's an example:

Would you be interested in helping us to align to Docsy? If we do that, the logo is likely to end up centered, although by a different mechanism.
dc1ec33
to
2984433
Compare
Ooops. Glad you caught that regression. I initially wrote the fix with CSS and explicit numeric breakpoint values. I swapped it to the SCSS bootstrap syntax to match the rest of the code before I committed and used It's fixed now and behaves appropriately. |
When I have some time I can also take a look at the other initiative(s) you mentioned too. Meanwhile, hoping this fix is a good addition as is. |
2984433
to
a610752
Compare
Use absolute positioning to horizontally center the navbar logo on md and smaller viewports. Prevents the hamburger menu from causing a visual offset.
a610752
to
6c1987b
Compare
Description
The navbar's logo on medium and small viewports was intended to be centered but was visually offset to the left because the hamburger icon's position in the DOM displaced it off-center.
This PR fixes the issue by applying absolute positioning and transform to keep the logo symmetrically centered horizontally within the navbar across responsive breakpoints.
This improves UX on mobile devices by enhancing visual balance as the user scrolls the page with the fixed navbar.
Screenshots
Before

After
