-
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
Add __next40pxDefaultSize for files in editor 3 #65139
Add __next40pxDefaultSize for files in editor 3 #65139
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. |
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @AKSHAT2802! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
@@ -428,8 +428,7 @@ export function HierarchicalTermSelector( { slug } ) { | |||
{ ! loading && hasCreateAction && ( | |||
<FlexItem> | |||
<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.
Looks good 👍
@mirka, it felt off that we're forcing the size prop here. After all variant="link"
buttons override the height to auto
anyway? We're almost done with this migration, but if we were just beginning with it, maybe it would have made sense to exclude the variant="link"
buttons from enforcing the size prop.
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.
Yeah, that makes sense. We'll make sure to exclude these when we start throwing deprecation warnings in console.
@@ -62,8 +62,7 @@ export default function MostUsedTerms( { onSelect, taxonomy } ) { | |||
{ terms.map( ( term ) => ( | |||
<li key={ term.id }> | |||
<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.
Ah, we have an awkward override here:
gutenberg/packages/editor/src/components/post-taxonomies/style.scss
Lines 38 to 40 in ecbde0e
.components-button { | |
font-size: 12px; | |
} |
My preference: I'd just remove that override, and go with the 13px
. The default font size is 13px, so it wouldn't make much difference.
If we really wanted to make it smaller, we could use the size="small"
prop, although I don't see a good reason to do it here.
@@ -110,8 +110,7 @@ export default function PostURL( { onClose } ) { | |||
} | |||
suffix={ | |||
<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.
This was already defacto addressed as part of #64824 - InputControl
would pass the __next40pxDefaultSize
size prop along to the prefix and suffix component, and the underlying Button
was obtaining it.
It's likely you were using an old trunk
when making the Before
screenshot. In my testing, I see a 40px height button already, with and without this change. However, for consistency, it only makes sense we pass that prop here.
So, nothing to do here 👍
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.
Actually these screenshots are of a different UI. This file renders this UI here:
☝️ Since this is in an InputControl prefix slot, we want this copy button to be size="small"
, and wrap it in a <InputControlSuffixWrapper variant="control">
.
Please see this With Icon Or Control story for an example.
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.
Thanks for working on this one @AKSHAT2802 🙌
Things mostly look good, but there are some opportunities for cleanup.
My biggest concern is the lack of consistency with the rest of the PostSummary
buttons if we merge this one separately. Should we merge together with the rest? cc @mirka @ciampo
@@ -428,8 +428,7 @@ export function HierarchicalTermSelector( { slug } ) { | |||
{ ! loading && hasCreateAction && ( | |||
<FlexItem> | |||
<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.
Looks good 👍
@mirka, it felt off that we're forcing the size prop here. After all variant="link"
buttons override the height to auto
anyway? We're almost done with this migration, but if we were just beginning with it, maybe it would have made sense to exclude the variant="link"
buttons from enforcing the size prop.
@@ -62,8 +62,7 @@ export default function MostUsedTerms( { onSelect, taxonomy } ) { | |||
{ terms.map( ( term ) => ( | |||
<li key={ term.id }> | |||
<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.
Ah, we have an awkward override here:
gutenberg/packages/editor/src/components/post-taxonomies/style.scss
Lines 38 to 40 in ecbde0e
.components-button { | |
font-size: 12px; | |
} |
My preference: I'd just remove that override, and go with the 13px
. The default font size is 13px, so it wouldn't make much difference.
If we really wanted to make it smaller, we could use the size="small"
prop, although I don't see a good reason to do it here.
@@ -110,8 +110,7 @@ export default function PostURL( { onClose } ) { | |||
} | |||
suffix={ | |||
<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 was already defacto addressed as part of #64824 - InputControl
would pass the __next40pxDefaultSize
size prop along to the prefix and suffix component, and the underlying Button
was obtaining it.
It's likely you were using an old trunk
when making the Before
screenshot. In my testing, I see a 40px height button already, with and without this change. However, for consistency, it only makes sense we pass that prop here.
So, nothing to do here 👍
…t 13px size in style as it is default
@AKSHAT2802 Could we also address this one please? #65139 (comment) |
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.
Perfect, thanks!
Part of - #65018
What?
Issue - #65018, To use default to 40px for the button.
Why?
To make the consistent button across Gutenberg, and we would have a lint rule added once fixed, all the button usage.
How?
Add __next40pxDefaultSize in button on the component.
Testing Instructions
Screenshots added as comments in file changes