Skip to content

Commit

Permalink
Normalize block inspector controls spacing (#64526)
Browse files Browse the repository at this point in the history
* Try block inspector controls spacing normalization

* Decrease specificity

* Add changelog

* Grid block: Fix when experimental grid interactivity

* Remove adjustment for bottom padding

* Revert "Add changelog"

This reverts commit 7939750.

* Remove unnecessary margin on Layout hook toggle (#65133)

Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
  • Loading branch information
5 people authored Sep 11, 2024
1 parent 8a7df39 commit 8a74d31
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
}

.components-base-control {
margin-bottom: #{ $grid-unit-30 };

&:last-child {
margin-bottom: $grid-unit-10;
&:where(:not(:last-child)) {
margin-bottom: $grid-unit-20;
}
}

Expand Down
1 change: 0 additions & 1 deletion packages/block-editor/src/hooks/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ function LayoutPanelPure( {
<>
<ToggleControl
__nextHasNoMarginBottom
className="block-editor-hooks__toggle-control"
label={ __( 'Inner blocks use content width' ) }
checked={
layoutType?.name === 'constrained' ||
Expand Down
4 changes: 0 additions & 4 deletions packages/block-editor/src/hooks/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,3 @@
margin-bottom: $grid-unit-10;
}
}

.block-editor-hooks__toggle-control.block-editor-hooks__toggle-control {
margin-bottom: $grid-unit-20;
}
29 changes: 16 additions & 13 deletions packages/block-editor/src/layouts/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
__experimentalUnitControl as UnitControl,
__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,
__experimentalVStack as VStack,
} from '@wordpress/components';
import { useState } from '@wordpress/element';

Expand Down Expand Up @@ -85,19 +86,21 @@ export default {
layout={ layout }
onChange={ onChange }
/>
{ showColumnsControl && (
<GridLayoutColumnsAndRowsControl
layout={ layout }
onChange={ onChange }
allowSizingOnChildren={ allowSizingOnChildren }
/>
) }
{ showMinWidthControl && (
<GridLayoutMinimumWidthControl
layout={ layout }
onChange={ onChange }
/>
) }
<VStack spacing={ 4 }>
{ showColumnsControl && (
<GridLayoutColumnsAndRowsControl
layout={ layout }
onChange={ onChange }
allowSizingOnChildren={ allowSizingOnChildren }
/>
) }
{ showMinWidthControl && (
<GridLayoutMinimumWidthControl
layout={ layout }
onChange={ onChange }
/>
) }
</VStack>
</>
);
},
Expand Down

0 comments on commit 8a74d31

Please sign in to comment.