Skip to content

Commit

Permalink
- Activating margin block support for the cover block at the block le…
Browse files Browse the repository at this point in the history
…vel.

- Activating margin block support in experimental-default-theme.json so that it's turned on in development by default.
- Removing BoxControlVisualizer for padding to avoid incongruity, that is, that it's on for padding and not for margin
- To add a BoxControlVisualizer for margin we would have to introduce a wrapper around the entire block in edit.js for margin to display properly.
  • Loading branch information
ramonjd committed Sep 13, 2021
1 parent 6be8b7d commit 59eb408
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 6 additions & 0 deletions lib/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,12 @@
"customRadius": true
}
},
"core/cover": {
"spacing": {
"customMargin": true,
"customPadding": true
}
},
"core/pullquote": {
"border": {
"customColor": true,
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/cover/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"html": false,
"spacing": {
"padding": true,
"margin": true,
"__experimentalDefaultControls": {
"padding": true
}
Expand Down
7 changes: 0 additions & 7 deletions packages/block-library/src/cover/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ const INNER_BLOCKS_TEMPLATE = [
],
];

const { __Visualizer: BoxControlVisualizer } = BoxControl;

function retrieveFastAverageColor() {
if ( ! retrieveFastAverageColor.fastAverageColor ) {
retrieveFastAverageColor.fastAverageColor = new FastAverageColor();
Expand Down Expand Up @@ -320,7 +318,6 @@ function CoverEdit( {
isRepeated,
minHeight,
minHeightUnit,
style: styleAttribute,
url,
alt,
} = attributes;
Expand Down Expand Up @@ -670,10 +667,6 @@ function CoverEdit( {
style={ { ...style, ...blockProps.style } }
data-url={ url }
>
<BoxControlVisualizer
values={ styleAttribute?.spacing?.padding }
showValues={ styleAttribute?.visualizers?.padding }
/>
<ResizableCover
className="block-library-cover__resize-container"
onResizeStart={ () => {
Expand Down

0 comments on commit 59eb408

Please sign in to comment.