Skip to content

Commit

Permalink
Fix: Button: Replace remaining 40px default size violation [Block lib…
Browse files Browse the repository at this point in the history
…rary] (#65075)

* Fix navigation-link block to use button to default 40px size

* Fix navigation deleted create new menu button to use 40px default size

* Fix navigation overlay menu icon button to use 40px default size

* Fix the navigation menu delete button to use 40px default size button

* Fix navigation placeholder start empty to use button as default 40px size

* Fix responsive navigation overlay menu open button to use default 40px size

* Fix navigation responsive close button to use 40px default size

* Add the !important to override the overlay menu preview style

Ref - #65075 (comment)

* Refactor the comment for the !important style

Co-authored-by: hbhalodia <[email protected]>
Co-authored-by: mirka <[email protected]>
  • Loading branch information
3 people authored Sep 6, 2024
1 parent c90f1c5 commit 219be48
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 15 deletions.
3 changes: 1 addition & 2 deletions packages/block-library/src/navigation-link/link-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,7 @@ const LinkUITools = ( { setAddingBlock, focusAddBlockButton } ) => {
return (
<VStack className="link-ui-tools">
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
ref={ addBlockButtonRef }
icon={ plus }
onClick={ ( e ) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ function DeletedNavigationWarning( { onCreateNew } ) {
{
button: (
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
onClick={ onCreateNew }
variant="link"
/>
Expand Down
3 changes: 1 addition & 2 deletions packages/block-library/src/navigation/edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -591,8 +591,7 @@ function Navigation( {
{ isResponsive && (
<>
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
className={ overlayMenuPreviewClasses }
onClick={ () => {
setOverlayMenuPreview(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ export default function NavigationMenuDeleteControl( { onDelete } ) {
return (
<>
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
className="wp-block-navigation-delete-menu-button"
variant="secondary"
isDestructive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ export default function NavigationPlaceholder( {

{ canUserCreateNavigationMenus && (
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
variant="tertiary"
onClick={ onCreateEmpty }
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ export default function ResponsiveWrapper( {
<>
{ ! isOpen && (
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
aria-haspopup="true"
aria-label={ hasIcon && __( 'Open menu' ) }
className={ openButtonClasses }
Expand All @@ -102,8 +101,7 @@ export default function ResponsiveWrapper( {
>
<div { ...dialogProps }>
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
className="wp-block-navigation__responsive-container-close"
aria-label={ hasIcon && __( 'Close menu' ) }
onClick={ () => onToggle( false ) }
Expand Down
6 changes: 5 additions & 1 deletion packages/block-library/src/navigation/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,11 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
width: 100%;
background-color: $gray-100;
padding: 0 $grid-unit-30;
height: $grid-unit-40 * 2;

// Adding !important to override default 40px size.
// Ref - https://github.com/WordPress/gutenberg/pull/65075#discussion_r1746282734
height: $grid-unit-40 * 2 !important;

margin-bottom: $grid-unit-15;

&.open {
Expand Down

0 comments on commit 219be48

Please sign in to comment.