Fix: Button Replace remaining 40px default size violations [Block Editor 3]#65225
Fix: Button Replace remaining 40px default size violations [Block Editor 3]#65225mirka merged 11 commits intoWordPress:trunkfrom
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
| <Button | ||
| // TODO: Switch to `true` (40px size) if possible | ||
| __next40pxDefaultSize={ false } | ||
| __next40pxDefaultSize |
| <Button | ||
| // TODO: Switch to `true` (40px size) if possible | ||
| __next40pxDefaultSize={ false } | ||
| __next40pxDefaultSize |
There was a problem hiding this comment.
I'm not sure about this one. I think it should be more like ToggleGroupControl. IE the outer container is 40px, while the inner buttons are 32px (compact size).
There was a problem hiding this comment.
@jameskoster what about just using a ToggleGroupControl?
There was a problem hiding this comment.
The visible stroke in the resting state would create additional weight that is probably unwanted in this UI.
We have an issue to explore the ToggleGroupControl design here, which might make it appropriate for use in its vanilla state if implemented.
But until then the simpler approach is probably to just make these buttons compact (32px).
| <Button | ||
| // TODO: Switch to `true` (40px size) if possible | ||
| __next40pxDefaultSize={ false } | ||
| __next40pxDefaultSize |
There was a problem hiding this comment.
Hi @jameskoster, I have removed the styles that were overriding the component button padding to fix the small icons. Also fixed the empty placeholder height.
| __next40pxDefaultSize={ false } | ||
| { ...toggleProps } | ||
| > | ||
| <Button __next40pxDefaultSize { ...toggleProps }> |
| __next40pxDefaultSize={ false } | ||
| { ...toggleProps } | ||
| > | ||
| <Button __next40pxDefaultSize { ...toggleProps }> |
| <Button | ||
| // TODO: Switch to `true` (40px size) if possible | ||
| __next40pxDefaultSize={ false } | ||
| __next40pxDefaultSize |
| __next40pxDefaultSize={ false } | ||
| { ...toggleProps } | ||
| > | ||
| <Button __next40pxDefaultSize { ...toggleProps }> |
| <Button | ||
| // TODO: Switch to `true` (40px size) if possible | ||
| __next40pxDefaultSize={ false } | ||
| __next40pxDefaultSize |
There was a problem hiding this comment.
@WordPress/gutenberg-design ?
Seems to me like we just want normal <button>s (with the original size) here, not sure why use Button if these are fully custom.
There was a problem hiding this comment.
It seems that the Shadow Palette has used the Button component since it was first implemented: https://github.com/WordPress/gutenberg/pull/46502/files#diff-d3db145a5a2d621586d0b1740cc8b403e58afac79bfe418bf7752fa3af88dc2bR164-R171
I don't know why the Button component was used, but based on this comment, it seems that we were trying to imitate the style of the color palette (CircularOptionPicker.Option component).
In fact, the CircularOptionPicker.Option component is also implemented internally as a Button component and is fully customized (source)
There was a problem hiding this comment.
For this PR it's probably best to keep those buttons visually looking the same as before, regardless of what component is used. A button element rather than the component may be a fine solution there.
Longer term, we should find a better design for these that's clearer.
There was a problem hiding this comment.
It would be good to avoid the arbitrary 26px sizing and use of the more standardised options (24, 32, or 40).
There was a problem hiding this comment.
I also noticed that wrapping the button with a Tooltip breaks the Composite's keyboard navigation, so we need to wrap the entire Composite.Item with the Tooltip.
☝️ @ciampo Did you know about this quirk? Not immediately sure why that is. The Tooltip embedded in a Button component doesn't break Composite.
There was a problem hiding this comment.
No, I wasn't aware. Maybe we should open a separate issue to at least track this quirk
There was a problem hiding this comment.
Hi @t-hamano I have updated <button> as per your suggestion. Let me know if anything else needs to be updated. 🙇
There was a problem hiding this comment.
Thanks for the update. I think it perfectly maintains its functionality and style 👍
| <Button | ||
| // TODO: Switch to `true` (40px size) if possible | ||
| __next40pxDefaultSize={ false } | ||
| __next40pxDefaultSize |
DaniGuardiola
left a comment
There was a problem hiding this comment.
LGTM except for the shadow buttons, see https://github.com/WordPress/gutenberg/pull/65225/files#r1755854718
Let's wait for design feedback.
mirka
left a comment
There was a problem hiding this comment.
I had one small nit, but everything else looks good now 👍
Co-authored-by: Lena Morita <lena@jaguchi.com>
Co-authored-by: Lena Morita <lena@jaguchi.com>
mirka
left a comment
There was a problem hiding this comment.
Looks great, thank you for the follow-ups!
|
When I try to cherry-pick df5eaed onto |
…tor 3] (#65225) * Fix: Global Styles component to use 40px default size. * Fix: Block variation picket to use 40px default size. * Fix: Block variation transform to use 40px default size. * Fix: color gradient dropdown and block appender button to use 40px default size. * fix: shadowpanel clear button * fix: Button Block appender issues. * fix: Coverts shadow panel Buttons to normal html buttons. * Update packages/block-library/src/group/editor.scss Co-authored-by: Lena Morita <lena@jaguchi.com> * Update packages/block-library/src/group/editor.scss Co-authored-by: Lena Morita <lena@jaguchi.com> * feat: Add tootlip tu shadow button. --------- Co-authored-by: vipul0425 <vipulgupta003@git.wordpress.org> Co-authored-by: DaniGuardiola <daniguardiola@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org> Co-authored-by: jameskoster <jameskoster@git.wordpress.org> Co-authored-by: tyxla <tyxla@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: ciampo <mciampini@git.wordpress.org>
|
@noisysocks I'm confused, it looks like you already backported it for us in 53b4edf ? |

















Part of - #65018
What?
This would fix in that in subtask
block-editor-3.Why?
To make the consistent button across Gutenberg, and we would have a lint rule added once fixed, all the button usage.
How?
Change from
__next40pxDefaultSize={ false }to__next40pxDefaultSizeon component.Testing Instructions
Testing steps and screenshots are added below.