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 24, 2021
1 parent 039d087 commit f8f1e9d
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 @@ -65,8 +65,6 @@ import {
getPositionClassName,
} from './shared';

const { __Visualizer: BoxControlVisualizer } = BoxControl;

function getInnerBlocksTemplate( attributes ) {
return [
[
Expand Down Expand Up @@ -318,7 +316,6 @@ function CoverEdit( {
isRepeated,
minHeight,
minHeightUnit,
style: styleAttribute,
url,
alt,
} = attributes;
Expand Down Expand Up @@ -675,10 +672,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 f8f1e9d

Please sign in to comment.