Skip to content

Commit

Permalink
Add border radius support to image block
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Dec 11, 2020
1 parent 37163dc commit 01f3319
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/block-library/src/image/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@
}
},
"supports": {
"anchor": true
"anchor": true,
"__experimentalBorder": {
"radius": true
}
},
"editorStyle": "wp-block-image-editor",
"style": "wp-block-image"
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/image/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/image/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
max-width: 100%;
}

&:not(.is-style-rounded) img {
border-radius: inherit;
}

&.aligncenter {
text-align: center;
}
Expand Down

0 comments on commit 01f3319

Please sign in to comment.