Skip to content

Commit

Permalink
Adjust vertical spacing.
Browse files Browse the repository at this point in the history
  • Loading branch information
afercia committed Sep 2, 2024
1 parent 5c6c889 commit abe58c3
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 52 deletions.
6 changes: 6 additions & 0 deletions packages/block-editor/src/hooks/layout.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
.block-editor-hooks__layout-controls-units {
display: flex;
flex-direction: column;
gap: $grid-unit-20;
}

.block-editor-block-inspector .block-editor-hooks__layout-controls-unit-input {
margin-bottom: 0;
}
Expand Down
100 changes: 48 additions & 52 deletions packages/block-editor/src/layouts/constrained.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,63 +72,59 @@ export default {
return (
<>
{ allowCustomContentAndWideSize && (
<>
<div className="block-editor-hooks__layout-controls-unit">
<UnitControl
__next40pxDefaultSize
className="block-editor-hooks__layout-controls-unit-input"
label={ __( 'Content width' ) }
labelPosition="top"
value={ contentSize || wideSize || '' }
onChange={ ( nextWidth ) => {
nextWidth =
0 > parseFloat( nextWidth )
? '0'
: nextWidth;
onChange( {
...layout,
contentSize: nextWidth,
} );
} }
units={ units }
prefix={
<InputControlPrefixWrapper variant="icon">
<Icon icon={ alignNone } />
</InputControlPrefixWrapper>
}
/>
</div>
<div className="block-editor-hooks__layout-controls-unit">
<UnitControl
__next40pxDefaultSize
className="block-editor-hooks__layout-controls-unit-input"
label={ __( 'Wide width' ) }
labelPosition="top"
value={ wideSize || contentSize || '' }
onChange={ ( nextWidth ) => {
nextWidth =
0 > parseFloat( nextWidth )
? '0'
: nextWidth;
onChange( {
...layout,
wideSize: nextWidth,
} );
} }
units={ units }
prefix={
<InputControlPrefixWrapper variant="icon">
<Icon icon={ stretchWide } />
</InputControlPrefixWrapper>
}
/>
</div>
<div className="block-editor-hooks__layout-controls-units">
<UnitControl
__next40pxDefaultSize
className="block-editor-hooks__layout-controls-unit-input"
label={ __( 'Content width' ) }
labelPosition="top"
value={ contentSize || wideSize || '' }
onChange={ ( nextWidth ) => {
nextWidth =
0 > parseFloat( nextWidth )
? '0'
: nextWidth;
onChange( {
...layout,
contentSize: nextWidth,
} );
} }
units={ units }
prefix={
<InputControlPrefixWrapper variant="icon">
<Icon icon={ alignNone } />
</InputControlPrefixWrapper>
}
/>
<UnitControl
__next40pxDefaultSize
className="block-editor-hooks__layout-controls-unit-input"
label={ __( 'Wide width' ) }
labelPosition="top"
value={ wideSize || contentSize || '' }
onChange={ ( nextWidth ) => {
nextWidth =
0 > parseFloat( nextWidth )
? '0'
: nextWidth;
onChange( {
...layout,
wideSize: nextWidth,
} );
} }
units={ units }
prefix={
<InputControlPrefixWrapper variant="icon">
<Icon icon={ stretchWide } />
</InputControlPrefixWrapper>
}
/>
<p className="block-editor-hooks__layout-controls-helptext">
{ __(
'Customize the width for all elements that are assigned to the center or wide columns.'
) }
</p>
</>
</div>
) }
{ allowJustification && (
<ToggleGroupControl
Expand Down

0 comments on commit abe58c3

Please sign in to comment.