-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 block: Remove browser default padding from the two submenu buttons #50943
Conversation
Size Change: +58 B (0%) Total Size: 1.69 MB
ℹ️ View Unchanged
|
Flaky tests detected in d0d69b7. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6156017308
|
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.
Thanks for catching this detail. Giving a tentative green light because the code looks good and the issue seems real.
But it's really sensitive code, I wonder, what's a good way to test this beyond more reviews?
Like visual regression tests? |
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 fixes the mismatch in spacing for me 🎉
I'm still seeing a slight difference in positioning between the buttons and the anchor tags when toggling the "Open on click" option, which would be nice to fix too, but I don't think it should hold up this PR:
Screen.Recording.2023-08-18.at.15.18.51.mov
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.
LGTM! I'm not seeing the slight spacing difference when toggling the "Open on click" option anymore 🎉
What?
When the Navigation Block: "Open on click" setting is used, the submenu button has some extra padding from browser styles. This padding means that in vertical menus, the button text on the submenu parent item does not align with the other links.
This PR sets the padding to 0.
Closes
#50722
Why?
To make the menu items align better.
How?
The implementation of the sub menu toggle button is a little bit different in the page list block and in the "regular" sub menu of navigation links. So there are two style changes, one for each button.
Testing Instructions
Screenshots or screencast
I am using a classic theme that does not add any extra CSS.
To clarify, the "Sample page" text is the page list submenu parent item, and
"preformatted" is a post title, it is the regular submenu parent item.
Before:
After: