Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
#113 - This PR aims to introduce a
border radius
option alongside the current border option.This approach aims to replicate the border radius option found within the block editor, as it appears that there is currently no
core
component which handles a radius option, likewise neither do the components BorderBoxControl or BorderControl.NOTE - This PR relies on the block preview PR which is yet to be merged. The reason for this was to ensure the border radius addition worked correctly across both the
code
andvisual
previews.In this approach it is possible to set a singular
Linked
value for the border radius andUnlinked
values, where each corner can be controlled independently. When switching fromLinked
toUnlinked
, theLinked
value populates each corner input initially. When switching fromUnlinked
toLinked
, the top left value is used as the singular value.Change Log
src/editor/components/StylesBorder.js
- Including radius component in the layoutsrc/editor/components/StylesBorderRadius.js
- The new componentSteps to test
Button
Border and radius
is in viewRadius
Linked value using the input boxVisual
view is selected, notice the border radius will change accordinglyCode
view is selected, notice the value of the radius property will change accordinglyRadius
Linked value using the range sliderUnlink
button to reveal 4 input boxes, one for each corner of the elementVisual
andCode
viewsScreenshots/Videos
A demo showing various interactions with the radius setting and the visual preview
A demo showing various interactions with the radius setting and the code preview
Checklist: