Skip to content
Merged
Prev Previous commit
Next Next commit
Hacky attempt to progress the behaviour forward slightly, will be par…
…tially reverted
  • Loading branch information
andrewserong committed Aug 25, 2022
commit 20b716750ba8de5272e52c64e834083592e207b0
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ export default function SpacingInputControl( {
label={ ariaLabel }
hideLabelFromVision={ true }
className="components-spacing-sizes-control__custom-value-input"
style={ { gridColumn: '1' } }
/>

<RangeControl
Expand Down
17 changes: 12 additions & 5 deletions packages/block-editor/src/layouts/constrained.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,18 @@ export default {
const blockGapStyleValue = getGapCSSValue( style?.spacing?.blockGap );
// If a block's block.json skips serialization for spacing or
// spacing.blockGap, don't apply the user-defined value to the styles.
const blockGapValue =
blockGapStyleValue?.top &&
! shouldSkipSerialization( blockName, 'spacing', 'blockGap' )
? blockGapStyleValue?.top
: '';
// const blockGapValue =
// blockGapStyleValue?.top &&
// ! shouldSkipSerialization( blockName, 'spacing', 'blockGap' )
// ? blockGapStyleValue?.top
// : '';

// This isn't _quite_ the right fix. We need to account for split values, and reference `top` if it's provided directly.
const blockGapValue = blockGapStyleValue;
console.log(
'blockGapStyleValue in constrained layout',
blockGapStyleValue
);

let output =
!! contentSize || !! wideSize
Expand Down
14 changes: 9 additions & 5 deletions packages/block-editor/src/layouts/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,15 @@ export default {

// If a block's block.json skips serialization for spacing or
// spacing.blockGap, don't apply the user-defined value to the styles.
const blockGapValue =
blockGapStyleValue?.top &&
! shouldSkipSerialization( blockName, 'spacing', 'blockGap' )
? blockGapStyleValue?.top
: '';
// const blockGapValue =
// blockGapStyleValue?.top &&
// ! shouldSkipSerialization( blockName, 'spacing', 'blockGap' )
// ? blockGapStyleValue?.top
// : '';

// This isn't _quite_ the right fix. We need to account for split values, and reference `top` if it's provided directly.
const blockGapValue = blockGapStyleValue;
console.log( 'blockGapStyleValue in flow layout', blockGapStyleValue );

let output = '';

Expand Down