Skip to content

Commit

Permalink
Columns block: Enable blockGap and vertical margin support (#34630)
Browse files Browse the repository at this point in the history
* Columns block: Enable blockGap and vertical margin support

* Update blockGap label to Block spacing

* Remove single-column class, add 80px width to UnitControls
  • Loading branch information
andrewserong committed Oct 5, 2021
1 parent f45dce1 commit 1d99ae2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
3 changes: 1 addition & 2 deletions packages/block-editor/src/hooks/dimensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,8 @@ export function DimensionsPanel( props ) {
) }
{ ! isGapDisabled && (
<ToolsPanelItem
className="single-column"
hasValue={ () => hasGapValue( props ) }
label={ __( 'Block gap' ) }
label={ __( 'Block spacing' ) }
onDeselect={ () => resetGap( props ) }
resetAllFilter={ createResetAllFilter( 'blockGap' ) }
isShownByDefault={ defaultSpacingControls?.blockGap }
Expand Down
3 changes: 2 additions & 1 deletion packages/block-editor/src/hooks/gap.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ export function GapEdit( props ) {
web: (
<>
<UnitControl
label={ __( 'Block gap' ) }
label={ __( 'Block spacing' ) }
__unstableInputWidth="80px"
min={ 0 }
onChange={ onChange }
units={ units }
Expand Down
7 changes: 7 additions & 0 deletions packages/block-library/src/columns/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
"color": {
"gradients": true,
"link": true
},
"spacing": {
"blockGap": true,
"margin": [ "top", "bottom" ],
"__experimentalDefaultControls": {
"blockGap": true
}
}
},
"editorStyle": "wp-block-columns-editor",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,14 @@ export default function DimensionsPanel( { context, getStyle, setStyle } ) {
) }
{ showGapControl && (
<ToolsPanelItem
className="single-column"
hasValue={ hasGapValue }
label={ __( 'Block gap' ) }
label={ __( 'Block spacing' ) }
onDeselect={ resetGapValue }
isShownByDefault={ true }
>
<UnitControl
label={ __( 'Block gap' ) }
label={ __( 'Block spacing' ) }
__unstableInputWidth="80px"
min={ 0 }
onChange={ setGapValue }
units={ units }
Expand Down

0 comments on commit 1d99ae2

Please sign in to comment.