-
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
Fix the block toolbar styles to evenly space buttons #39630
Conversation
Size Change: -838 B (0%) Total Size: 1.21 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.
This is an incredible cleanup, thanks so much. I was rather sure this would require a massive refactor of the block toolbar markup itself, the fact that it's all CSS is impressive.
After:
The metrics are as you say:
It works great with plugins as well:
And the focus outline works as it should:
I would love to get some more eyes on this, to get people to test with a variety of blocks and plugins in addition to what I've tested. But from what I can see, this is entirely solid.
Follow-up to #39605
What?
In #39605 (comment) we noticed that the block toolbar spacing is not correct when the block toolbar contains two buttons with descriptions. The descriptions show hidden divs in the DOM impacting the
:first-child
last-child
selectors that are supposed to apply the correct styles to the button toolbars.How?
This PR solves that by removing the special cases from the "first" and "last" child buttons of block toolbars. Instead the containing toolbar group now has a 6px padding. The impact here is that the click area of the first and last buttons of a "toolbar group" is a bit smaller but it's also more consistent with all the remaining toolbar buttons.
Testing Instructions
1- Use different blocks and toolbars
2- make sure the toolbar buttons are evenly spaced.
Screenshots or screencast
I added a red outline to the impacted buttons in the screenshots here