Skip to content

Commit

Permalink
Fix: Button Replace remaining 40px default size violations [Block Edi…
Browse files Browse the repository at this point in the history
…tor 4] (#65257)

* fix: Inserter lightbox's button to use 40px default size.

* fix: Pattern Explorer Sidebar's button to use 40px default size.

* fix: Block Pattern's button to use 40px default size.

* fix: Media Preview's button to use 40px default size.

* fix: Media Tab's button to use 40px default size.

* fix: Quick Inserter's button to use 40px default size.

Co-authored-by: vipul0425 <vipulgupta003@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
  • Loading branch information
3 people authored Sep 18, 2024
1 parent b818be2 commit 98b8d41
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ function InserterListboxItem(
return children( propsWithTabIndex );
}
return (
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
{ ...propsWithTabIndex }
>
<Button __next40pxDefaultSize { ...propsWithTabIndex }>
{ children }
</Button>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ function PatternCategoriesList( {
{ patternCategories.map( ( { name, label } ) => {
return (
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
key={ name }
label={ label }
className={ `${ baseClassName }__categories-list__item` }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ function BlockPatternsTab( {
{ children }
</CategoryTabs>
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
className="block-editor-inserter__patterns-explore-button"
onClick={ () => setShowPatternsExplorer( true ) }
variant="secondary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ function InsertExternalImageModal( { onClose, onSubmit } ) {
>
<FlexItem>
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
variant="tertiary"
onClick={ onClose }
>
Expand All @@ -110,8 +109,7 @@ function InsertExternalImageModal( { onClose, onSubmit } ) {
</FlexItem>
<FlexItem>
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
variant="primary"
onClick={ onSubmit }
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ function MediaTab( {
allowedTypes={ ALLOWED_MEDIA_TYPES }
render={ ( { open } ) => (
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
onClick={ ( event ) => {
// Safari doesn't emit a focus event on button elements when
// clicked and we need to manually focus the button here.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ export default function QuickInserter( {

{ setInserterIsOpened && (
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
className="block-editor-inserter__quick-inserter-expand"
onClick={ onBrowseAll }
aria-label={ __(
Expand Down
1 change: 0 additions & 1 deletion packages/block-editor/src/components/inserter/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ $block-inserter-tabs-height: 44px;
background: $gray-900;
color: $white;
width: 100%;
height: ($button-size + $grid-unit-10);
border-radius: 0;

&:hover {
Expand Down

0 comments on commit 98b8d41

Please sign in to comment.