-
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: 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. |
@@ -32,16 +32,14 @@ export function ConvertToLinksModal( { onClick, onClose, disabled } ) { | |||
</p> | |||
<div className="wp-block-page-list-modal-buttons"> | |||
<Button | |||
// TODO: Switch to `true` (40px size) if possible | |||
__next40pxDefaultSize={ false } | |||
__next40pxDefaultSize |
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.
variant="tertiary" | ||
onClick={ onClose } | ||
> | ||
{ __( 'Cancel' ) } | ||
</Button> | ||
<Button | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize |
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.
@@ -342,8 +342,7 @@ export default function PageListEdit( { | |||
<PanelBody title={ __( 'Edit this menu' ) }> | |||
<p>{ convertDescription }</p> | |||
<Button | |||
// TODO: Switch to `true` (40px size) if possible | |||
__next40pxDefaultSize={ false } | |||
__next40pxDefaultSize |
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.
@@ -84,8 +84,7 @@ const CommentsForm = ( { postId, postType } ) => { | |||
if ( 'closed' === commentStatus ) { | |||
const actions = [ | |||
<Button | |||
// TODO: Switch to `true` (40px size) if possible | |||
__next40pxDefaultSize={ false } | |||
__next40pxDefaultSize |
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.
@@ -308,8 +308,7 @@ export default function PostFeaturedImageEdit( { | |||
mediaLibraryButton={ ( { open } ) => { | |||
return ( | |||
<Button | |||
// TODO: Switch to `true` (40px size) if possible | |||
__next40pxDefaultSize={ false } | |||
__next40pxDefaultSize |
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.
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.
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.
@@ -627,8 +627,7 @@ export default function LogoEdit( { | |||
render={ ( { open } ) => ( | |||
<div className="block-library-site-logo__inspector-upload-container"> | |||
<Button | |||
// TODO: Switch to `true` (40px size) if possible | |||
__next40pxDefaultSize={ false } | |||
__next40pxDefaultSize |
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 ).
@@ -674,8 +673,7 @@ export default function LogoEdit( { | |||
mediaLibraryButton={ ( { open } ) => { | |||
return ( | |||
<Button | |||
// TODO: Switch to `true` (40px size) if possible | |||
__next40pxDefaultSize={ false } | |||
__next40pxDefaultSize |
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.
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.
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
@@ -81,8 +81,7 @@ const SocialLinkURLPopover = ( { | |||
/> | |||
</div> | |||
<Button | |||
// TODO: Switch to `true` (40px size) if possible | |||
__next40pxDefaultSize={ false } | |||
__next40pxDefaultSize |
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.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I would update this to TODO state.
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.
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, |
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.
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-form
andcore/social-link
Why?
How?
__next40pxDefaultSize={ false }
to__next40pxDefaultSize
on component.Testing Instructions