Repository navigation
Fix: Button: Replace remaining 40px default size violation [Block library 3] - #65110
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 |
| <Button | ||
| // TODO: Switch to `true` (40px size) if possible | ||
| __next40pxDefaultSize={ false } | ||
| __next40pxDefaultSize |
| <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.
There was a problem hiding this comment.
As @hbhalodia said, noting that the __next40pxDefaultSize prop here doesn't have an impact because of the style overrides applied to the placeholder and the button components in the post featured image block.
These style overrides should be removed, if possible — but it's not in the scope of this PR. We can keep changes as they are.
| <Button | ||
| // TODO: Switch to `true` (40px size) if possible | ||
| __next40pxDefaultSize={ false } | ||
| __next40pxDefaultSize |
There was a problem hiding this comment.
This can be seen, while you add core/site-logo block, and check the inspector controls to upload the logo.
Note: This has some styles that have higher specificity and specific to this button on this block, hence before and after is same, but we can see our change is applied in inspector controls.
| Before | After |
|---|---|
![]() |
![]() |
There was a problem hiding this comment.
We have style overrides in this case as well.
For the context of this PR, I think the current code changes are enough.
Still, I'd love to remove all of those overrides if possible, and just use a standard Button variant — although the situation is trickier than it looks. There are three possible UIs shown to the user:
- an upload button (the one in the image above)
- a "readonly" item group showing the logo preview;
- an interactive dropdown allowing to replace/remove the current logo
Therefore, we'd need to make sure that we could offer a good, consistent UI in all three cases even without those overrides. Something we could do in a follow-up (cc @WordPress/gutenberg-design )/
Also, I noticed that the dropdown comes from the MediaReplaceFlow component. That dropdown is using a ToolbarButton as its trigger, showing that it was only meant to be rendered in a toolbar — while here it's being used in the editor sidebar (cc @WordPress/gutenberg-components @ntsekouras @youknowriad ).
| <Button | ||
| // TODO: Switch to `true` (40px size) if possible | ||
| __next40pxDefaultSize={ false } | ||
| __next40pxDefaultSize |
There was a problem hiding this comment.
There was a problem hiding this comment.
Same as above. There are again a lot of style overrides, which ideally shouldn't be there at all.
The code change here is good for the scope of this PR
| <Button | ||
| // TODO: Switch to `true` (40px size) if possible | ||
| __next40pxDefaultSize={ false } | ||
| __next40pxDefaultSize |
There was a problem hiding this comment.
We should update the URLInput to a 40px height too — @mirka , do you know if that's feasible as of now? Or should we keep the TODO comment and revisit later?
There was a problem hiding this comment.
Mmm, this is kind of dependent on #64709, so I guess we can revert to TODO for now. I'll do something about it if the Button migrations get completed before the URLInput issue is addressed.
There was a problem hiding this comment.
Sure, I would update this to TODO state.
ciampo
left a comment
There was a problem hiding this comment.
Thank you for working on this!
Most of the changes LGTM to me for the scope of this PR. The only pending item is #65110 (comment)
Hi @ciampo @mirka, the PR is updated with the feedbacks. Thank You, |
ciampo
left a comment
There was a problem hiding this comment.
Changes LGTM given the scope of this PR.
Thank you, @hbhalodia 🙏














Part of - #65018
What?
core/page-list,core/site-logo,core/post-featured-image,core/post-comments-formandcore/social-linkWhy?
How?
__next40pxDefaultSize={ false }to__next40pxDefaultSizeon component.Testing Instructions