-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
BoxControl: Export applyValueToSides
util function
#42733
BoxControl: Export applyValueToSides
util function
#42733
Conversation
applyValueToSides
util function from BoxControlapplyValueToSides
util function from BoxControl
Size Change: +5 B (0%) Total Size: 1.27 MB
ℹ️ View Unchanged
|
This tested well for me @aaronrobertshaw, both as this PR, and also cherry-picked into #42173 and used in the spacing sizes control. |
Thanks for testing. Once I get the chance, I'll publish this ready for review and get the components squad's thoughts. |
applyValueToSides
util function from BoxControlapplyValueToSides
util function
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.
Yep, this makes sense to me! 🚢
This could avoid some code duplication for new components around spacing size presets.
8b915f1
to
5bb21ae
Compare
Related:
What?
Makes the
applyValueToSides
function within theBoxControl
a util which can then be exported via the components package.Why?
The new spacing sizes control being created within the block-editor could avoid code duplication if this was available.
Note: The spacing sizes control is very much a bespoke solution to the needs of the editor and as such, wasn't deemed generic enough for the components package itself.
How?
applyValueToSides
function out of theBoxControl
sides
Testing Instructions
BoxControl
's unit tests still passBoxControl
is still working correctlyBoxControl
behaves in the editor.