diff --git a/packages/block-editor/src/hooks/margin.js b/packages/block-editor/src/hooks/margin.js index 229e744f70d51e..b54374295ace0c 100644 --- a/packages/block-editor/src/hooks/margin.js +++ b/packages/block-editor/src/hooks/margin.js @@ -190,10 +190,10 @@ export function MarginVisualizer( { clientId, attributes } ) { borderRightWidth: marginRight, borderBottomWidth: marginBottom, borderLeftWidth: marginLeft, - top: marginTop !== 0 ? `-${ marginTop }` : 0, - right: marginRight !== 0 ? `-${ marginRight }` : 0, - bottom: marginBottom !== 0 ? `-${ marginBottom }` : 0, - left: marginLeft !== 0 ? `-${ marginLeft }` : 0, + top: marginTop !== 0 ? `calc(${ marginTop } * -1)` : 0, + right: marginRight !== 0 ? `calc(${ marginRight } * -1)` : 0, + bottom: marginBottom !== 0 ? `calc(${ marginBottom } * -1)` : 0, + left: marginLeft !== 0 ? `calc(${ marginLeft } * -1)` : 0, }; }, [ margin ] );