-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Customize widgets, edit post: refactor Button to new sizes #65807
Conversation
variant="secondary" | ||
ref={ ref } | ||
> | ||
<Button size="compact" variant="secondary" ref={ ref }> |
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.
- Active an non-blocks based theme
- Artificially
throw
somewhere in the package ( - Visit customizer, then widgets
Note: this button inherits some very generic style overrides, although this code is so legacy that we can probably keep it as-is without worrying too much.
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.
I'm okay with the style overrides FWIW, but I think this is a perfect fit for the size="compact"
, given the size of the neighbor buttons that are likely to not change in the future.
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.
Makes sense — so, just to make sure, no changes needed for this instance since size="compact"
is already being applied?
The height doesn't look like the compact
size because of the mentioned style overrides, which change (among other things) the box-sizing
CSS property, causing the height of the button to be different than intended.
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.
That's correct 👍
And whether we want to play with the style overrides in this PR in order to make the button height match better, I'll leave this to your judgment.
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.
I'd leave it since it's a legacy part of the codebase, and this error screen should (hopefully) not be seen often by users 🤞
@@ -37,8 +37,7 @@ function Inserter( { setIsOpened } ) { | |||
{ __( 'Add a block' ) } | |||
</h2> | |||
<Button | |||
// TODO: Switch to `true` (40px size) if possible | |||
__next40pxDefaultSize={ false } | |||
size="small" |
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.
@@ -43,8 +43,7 @@ export default function WelcomeGuide( { sidebar } ) { | |||
) } | |||
</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.
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.
Similarly, to be consistent with the sizing of the other buttons, I'd personally prefer size="compact"
for this one.
@@ -91,8 +91,7 @@ function FullscreenModeClose( { showTooltip, icon, href, initialPost } ) { | |||
return ( | |||
<motion.div whileHover="expand"> | |||
<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.
@@ -82,8 +82,7 @@ export default function InitPatternModal() { | |||
/> | |||
<HStack justify="right"> | |||
<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.
@@ -39,8 +39,7 @@ export function CustomFieldsConfirmation( { willEnable } ) { | |||
) } | |||
</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.
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. |
Size Change: -33 B (0%) Total Size: 1.77 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.
Looking good and testing well 👍
One thing: I'd personally prefer if we used compact buttons in the customizer, since that's closer to the size of the core buttons there. WDYT? See my inline comments.
I've also made some minor optional cleanup suggestions, feel free to take or toss.
variant="secondary" | ||
ref={ ref } | ||
> | ||
<Button size="compact" variant="secondary" ref={ ref }> |
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.
I'm okay with the style overrides FWIW, but I think this is a perfect fit for the size="compact"
, given the size of the neighbor buttons that are likely to not change in the future.
@@ -37,8 +37,7 @@ function Inserter( { setIsOpened } ) { | |||
{ __( 'Add a block' ) } | |||
</h2> | |||
<Button | |||
// TODO: Switch to `true` (40px size) if possible | |||
__next40pxDefaultSize={ false } | |||
size="small" | |||
className="customize-widgets-layout__inserter-panel-header-close-button" |
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.
I think we can remove this classname as it's unnecessary and I don't see usage in wpdirectory.
@@ -43,8 +43,7 @@ export default function WelcomeGuide( { sidebar } ) { | |||
) } | |||
</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.
Similarly, to be consistent with the sizing of the other buttons, I'd personally prefer size="compact"
for this one.
@@ -43,8 +43,7 @@ export default function WelcomeGuide( { sidebar } ) { | |||
) } | |||
</p> | |||
<Button | |||
// TODO: Switch to `true` (40px size) if possible | |||
__next40pxDefaultSize={ false } | |||
__next40pxDefaultSize | |||
className="customize-widgets-welcome-guide__button" |
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.
And another potentially removable classname.
@@ -39,8 +39,7 @@ export function CustomFieldsConfirmation( { willEnable } ) { | |||
) } | |||
</p> | |||
<Button | |||
// TODO: Switch to `true` (40px size) if possible | |||
__next40pxDefaultSize={ false } | |||
__next40pxDefaultSize | |||
className="edit-post-preferences-modal__custom-fields-confirmation-button" |
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.
Another classname to remove while we're here. The last usage of this one was removed a while ago in #35369.
You might need to update some snapshots if you remove it.
492a0d2
to
ff87070
Compare
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.
Looking good, thanks for addressing this last batch 🚀
Flaky tests detected in ff87070. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11144965151
|
…#65807) * Customize widgets, edit post: refactor Button usages to new component sizing * Update snapshots * Switch to compact size in the customize widgets welcome guide * Remove unused classnames, update snapshots --- Co-authored-by: ciampo <[email protected]> Co-authored-by: tyxla <[email protected]>
…ordPress#65807)" This reverts commit cd0916c.
* Customize widgets, edit post: refactor Button usages to new component sizing * Update snapshots * Switch to compact size in the customize widgets welcome guide * Remove unused classnames, update snapshots --- Co-authored-by: ciampo <[email protected]> Co-authored-by: tyxla <[email protected]>
What?
Part of #65018
Migrate some of the existing usages of
Button
to the new 40px sizingWhy?
See #65018
How?
By either setting
__next40pxDefaultSize
totrue
, or by applying a differentsize
Testing Instructions
See individual comments