-
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
Borders: Maintain radius in Global Styles #49950
Conversation
Size Change: +29 B (0%) Total Size: 1.37 MB
ℹ️ View Unchanged
|
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.
It works 👍
It doesn't feel like the tidiest code. Perhaps a separate onChangeRadius
callback might be an idea, so that it doesn't have to be destructured and restructured.
Fixing the bug is the most important thing, can always iterate on the exact solution.
Thanks for the quick review.
Agreed. This is a side effect of merging the block editor and global styles panels. To be able to adjust the resulting style object for global styles only, we have the entire styles object here and no obvious place for a separate An alternative would be to revisit an earlier approach where we passed a prop down to the underlying panel that actually manages the separate controls. At that level, we could handle the changes more independently.
I'll get this merged in the short term then. |
Follow up to #49738
What?
Fixes a regression introduced in #49738. When the global styles specific logic for border color, width, and style was moved to the global styles panel, maintaining the radius value wasn't accounted for.
Why?
Without this fix you can't set a border-radius in Global Styles.
How?
Now the onChange handler will only pass the border color, width, style, or side objects through to the function applying a border style fallback. The radius is deconstructed and added back to the new border style to be set.
Testing Instructions
Screenshots or screencast
Screen.Recording.2023-04-20.at.6.31.30.pm.mp4
Screen.Recording.2023-04-20.at.6.29.33.pm.mp4