-
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 block toolbar height and rounded corners of parent selector button when text label mode #49556
Conversation
Size Change: -7 B (0%) Total Size: 1.37 MB
ℹ️ View Unchanged
|
Flaky tests detected in 80b1459. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4676863099
|
Good catch! I have fixed that problem as well. This change should not affect the parent selector in default mode. |
Apologies, I should have mentioned this yesterday (and perhaps it's the reason for the rounded corners in the first place), should the button be detached from the toolbar, like it is when text labels are off? It's probably a separate point, but I also wonder about the label. "Select |
The main purpose of this PR is to eliminate 1px misalignment. I think the label and position of the parent select button may be better discussed in another issue. |
Thanks for the attention to detail. Agreed we can make small fixes and move forward. The truth is the "labels only" interface at the moment feels like it could benefit from a dedicated issue with a design. Noted across a couple of separate threads, the issue is that some of the labels need rephrasing when they are label only, and font size definitely needs to be considered. I like how the MacOS finder balances this: Again, all that's separate! Thanks for the work and the reviews! |
Fair enough! I'm not a huge fan of using negative <1px margins. It feels like it could be a bit fragile? Did you consider simply reducing the height of the move up/down buttons by 1px? That seems to address the issue as well. Are there other options? |
I have considered three other approaches to this approach: Change the height of the "Move up" button to 23pxThe "Move down" button is still 24px high, so the sizes do not match. Change the height of "Move up" and "Move down" buttons to 23.5pxA decimal point must be used, but no negative values are used. Absolute placement of the separator lineMargin with decimal points is needed to center the display completely at the top and bottom. The number of properties seems a bit large. Overall, I chose the simplest approach with the least amount of code. What do you think? |
573936b
to
3433047
Compare
Surely, that makes sense! I removed the border and it looks very natural. de8e0143bc44d321f11e9bd56f78b5c9.mp4 |
80b1459
to
d36662e
Compare
@jameskoster |
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.
Yup, I think so! Thanks for working on this :)
What?
This PR unifies the height of the block toolbar to 46px. This eliminates the misalignment of the buttons for selecting the parent block when "Show button text labels" mode is enabled.
edit: This PR also fixes the rounded corners on the parent selector button as pointed out in this comment.
Why?
The block toolbar is expected to be 46px high:
However, when "Show button text labels" mode is enabled, the toolbar height is 47px:
This is because the pseudo-element between "Move up" and "Move down" has a height of 1px:
This results in the height of the button to select the parent block being displaced if that block is a child:
How?
Since this problem can be solved by treating a 1px height border as having no height, there are many possible approaches. I have applied a total negative margin of 1px on the top and bottom, which seems the simplest.
Screenshots or screencast
Before
After