-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Navigation: adjust mobile close button position when admin bar is visible #41664
Conversation
Size Change: +94 B (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
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.
Thank you for this @mikachan. This looks right to me and now works as I would expect it to.
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.
This works well in themes where the menu is aligned to the right.
It is less obvious when the menu is in different positions, but still an improvement.
👋 Could you share which theme this is in, or the markup for this menu? I'm guessing the 'Start a project' button is absolutely positioned, or it's styled in another way which means the top margin doesn't affect it. Either way, I can take a look and spin up another PR. |
Hi @mikachan 👋 , the theme is something that I'm working on now, and it hasn't yet been released. The button is placed normally next to the navigation block in a Row block. Anyway, this is the markup of the entire header.
I've just tested this with Twenty Twenty-Two, and the issue can be seen with the theme too. Please let me know if there is anything that I can help with! |
Thanks, this helps a lot! I understand now, this is affecting items that aren't even inside an open mobile menu. Good spot! This should fix the issue: #41949 |
What?
This PR adjusts the position of the close button in the mobile navigation dialog when the user is logged in (when the admin bar is visible). Before, the close button would seem to jump in position compared to the hamburger menu.
Why?
This isn't an issue when the admin bar is not visible, so this aligns the two views.
How?
I've added a top margin to the dialog div which matches the
$admin-bar-height
or$admin-bar-height-big
, depending on the breakpoint.Testing Instructions
Screenshots or screencast
Before:
Screen.Recording.2022-06-10.at.16.25.22.mov
After:
Screen.Recording.2022-06-10.at.16.23.08.mov