From 01f3319b551d1f89a86bcaabaace57cc5cb9a80d Mon Sep 17 00:00:00 2001 From: Aaron Robertshaw <60436221+aaronrobertshaw@users.noreply.github.com> Date: Fri, 11 Dec 2020 17:02:27 +1000 Subject: [PATCH] Add border radius support to image block --- packages/block-library/src/image/block.json | 5 ++++- packages/block-library/src/image/editor.scss | 4 ++++ packages/block-library/src/image/style.scss | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/image/block.json b/packages/block-library/src/image/block.json index 02cfd21dfd9cd5..3952230ded6a31 100644 --- a/packages/block-library/src/image/block.json +++ b/packages/block-library/src/image/block.json @@ -71,7 +71,10 @@ } }, "supports": { - "anchor": true + "anchor": true, + "__experimentalBorder": { + "radius": true + } }, "editorStyle": "wp-block-image-editor", "style": "wp-block-image" diff --git a/packages/block-library/src/image/editor.scss b/packages/block-library/src/image/editor.scss index 563f68b9541c70..8e03e09dd6e9d0 100644 --- a/packages/block-library/src/image/editor.scss +++ b/packages/block-library/src/image/editor.scss @@ -22,6 +22,10 @@ figure.wp-block-image:not(.wp-block) { margin-top: -9px; margin-left: -9px; } + + &:not(.is-style-rounded) > div { + border-radius: inherit; + } } // This is necessary for the editor resize handles to accurately work on a non-floated, non-resized, small image. diff --git a/packages/block-library/src/image/style.scss b/packages/block-library/src/image/style.scss index a20c12dc9046b1..895d5e4dde2f2e 100644 --- a/packages/block-library/src/image/style.scss +++ b/packages/block-library/src/image/style.scss @@ -7,6 +7,10 @@ max-width: 100%; } + &:not(.is-style-rounded) img { + border-radius: inherit; + } + &.aligncenter { text-align: center; }