-
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
Block Supports: Use empty initial value for border-radius #29263
Conversation
Size Change: -12 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
Here's what I see: I'm personally a big fan. The default radius comes from the theme — in this case the block style, which actually sets the radius to 9999px, crazy high, to ensure it's always a perfect pill-shape regardless of the size. But as mentioned, a theme might set this radius to zero, or to 10 or 2. By allowing the radius to be unset, this just feels more honest. Really nice work. I'd love to approve, but will just let it sit a bit in case others have strong opionions. |
I think this should go in. For example Twenty Twenty-One uses 0 as the default border-radius and using 5 as the default feels wrong. To be able to use 5px as value you first have to set it to 4 or 6 and jump back to 5 - by not using the reset button. @stokesman Would you like to give this branch a rebase? |
Thanks for working on this! |
7537b6b
to
85860e5
Compare
@ocean90, now that #30194 is in the original version of this PR wasn't applicable. I've used the same branch but the scope of the PR has expanded to the block supports hook since that's now what provides the UI for the border-radius on the Button block. This means it would apply to any other blocks using that hook but I'm unaware of any at the moment. |
31483 has this covered |
🚀 |
As suggested in #29210. Initially, this was a PR for just the Button block. When #30194 landed it made the initial version of this PR not applicable and this PR has been rebased to instead change the block supports hook/UI. As I understand there would still be a way to make this apply only to the Button block but it seems like the saner default for the hook in general.
How has this been tested?
Putting buttons of various styles in a post and verifying their border-radius setting starts out empty. Then applying a border-radius and verifying that it resets to empty when reset.
Types of changes
Bug fix #29210
Checklist: