-
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] #65075
Changes from all commits
d1e1371
d41604c
6d2d3df
3edc766
338d4b3
f0febe5
977b741
ecf4b99
7c3d35c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,8 +16,7 @@ function DeletedNavigationWarning( { onCreateNew } ) { | |||||
{ | ||||||
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 commentThe reason will be displayed to describe this comment to others. Learn more. This can be seen when you use navigation ref which is deleted or not present. Also, this is kind of link which uses button component, but it has some overridden styles, so there would not be any effect on button. Still we have updated component to use default size, in future if specific styles get's removed, we have default
|
||||||
onClick={ onCreateNew } | ||||||
variant="link" | ||||||
/> | ||||||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -591,8 +591,7 @@ function Navigation( { | |||||||||
{ isResponsive && ( | ||||||||||
<> | ||||||||||
<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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. We're going to need to preserve this height override. I think we'll need to add an
Aside: @WordPress/gutenberg-components This is already the second time I'm seeing a height override like this that requires an additional
gutenberg/packages/components/src/button/style.scss Lines 28 to 30 in 9523fb4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Thanks for this, would add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a tricky balance. I lean on the side of not decreasing the specificity, especially since it's going to be removed soon anyway.
I'm not sure that adding "one more variant" is a scalable solution. Seeing how many heavily tweaked instances of Alternatively, we could expose a |
||||||||||
className={ overlayMenuPreviewClasses } | ||||||||||
onClick={ () => { | ||||||||||
setOverlayMenuPreview( | ||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,8 +19,7 @@ export default function NavigationMenuDeleteControl( { onDelete } ) { | |
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 commentThe reason will be displayed to describe this comment to others. Learn more. |
||
className="wp-block-navigation-delete-menu-button" | ||
variant="secondary" | ||
isDestructive | ||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -76,8 +76,7 @@ export default function NavigationPlaceholder( { | |||
|
||||
{ canUserCreateNavigationMenus && ( | ||||
<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 commentThe reason will be displayed to describe this comment to others. Learn more. I haven't being able to identify this change visually on the site, because the main component, It is being used here -
@mirka, Can you please verify this. Thank You, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it doesn't seem to be used anymore 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for confirmation 👍. |
||||
variant="tertiary" | ||||
onClick={ onCreateEmpty } | ||||
> | ||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -79,8 +79,7 @@ export default function ResponsiveWrapper( { | |||||
<> | ||||||
{ ! isOpen && ( | ||||||
<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 commentThe reason will be displayed to describe this comment to others. Learn more. This can be seen, while you add navigation and add the overlay menu icon to mobile or always show. Note: For this we have some overriding styles on the icon itself, so it would not have before and after change, but we can see that this change have added our 40px change, so in future if overriding styles is removed, we have default 40px of size.
|
||||||
aria-haspopup="true" | ||||||
aria-label={ hasIcon && __( 'Open menu' ) } | ||||||
className={ openButtonClasses } | ||||||
|
@@ -102,8 +101,7 @@ export default function ResponsiveWrapper( { | |||||
> | ||||||
<div { ...dialogProps }> | ||||||
<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 commentThe reason will be displayed to describe this comment to others. Learn more. This can be seen, while you add navigation and add the overlay menu icon to mobile or always show, and open the menu by click on overlay icon, you can see the close icon. Note: For this we have some overriding styles on the icon itself, so it would not have before and after change, but we can see that this change have added our 40px change, so in future if overriding styles is removed, we have default 40px of size.
|
||||||
className="wp-block-navigation__responsive-container-close" | ||||||
aria-label={ hasIcon && __( 'Close menu' ) } | ||||||
onClick={ () => onToggle( false ) } | ||||||
|
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 navigation-link block and while you add the link.