-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#113] - Radius not an option #117
base: develop
Are you sure you want to change the base?
Conversation
On further testing I noticed a bug in which the value would be stripped when toggling between A demo showing how the toggles work when stripping certain values can be seen here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @thatisrich - thanks for working on this! It works well during my testing, however whilst comparing things to Gutenberg I noticed there is a BorderRadiusControl component in there, were you aware of this, do you think we'd be able to update this PR to utilise it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into the WordPress component, this works well and using it means less maintenance for us 🙌
I don't think border radius will be needed as a standalone component, so IMO we should just use the BorderRadiusControl
within the StylesBorder
component, and add a new onChange
callback for it, just to keep things a bit neater, e.g:
const onRadiusChange = ( newValue ) => {
let config = structuredClone( userConfig );
config = set( config, `${ selector }.radius`, newValue );
setUserConfig( config );
};
setUserConfig( config ); | ||
}; | ||
|
||
return ( | ||
<> | ||
<span className="themer--styles__item__title"> | ||
{ __( 'Border', 'themer' ) } | ||
{ __( 'Border and radius', 'themer' ) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please can we keep this as "Border" as radius is just a part of the border styles
When further testing the Please see here for an updated screen recording showing the minor UI tweaks. |
Description
#113 - This PR aims to introduce a
border radius
option alongside the current border option.Using the experimental
BorderRadiusControl
component, a border radius can be applied using a singular value or 'unlinked' values for each corner of the element.This PR also addresses a slight mis-match in label
font-weight
by changing the value assigned to.themer--styles__item__label
from600
to500
.Change Log
src/editor/components/StylesBorder.js
- Including radius component in the layoutsrc/editor/components/StylesBorderRadius.js
- The new component to handle the radius values with theBorderRadiusControl
componentsrc/editor/styles/components/styles.scss
- Updates the custom label font weightSteps 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 previewA demo showing various interactions with the radius setting and the code previewAn updated demo showing the border radius setting in visual preview
An updated demo showing the border radius setting in code preview
Checklist: