Button Block: use computed style to set default border-radius #25720
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.
Taking a stab at #17596, this employs
getComputedStyle
to define the default border-radius for buttons.In a theme with square buttons:
Sorry about the weird artifacts on the bottom of these screen captures. Hopefully, they're not too distracting.
In a theme defining a border-radius larger than the current built-in maximum (and in units other than pixels thus the floating number):
It could be set up so that the maximum border-radius is raised by the computed style but not sure that's desired.
This works well with any theme I've tested. I think an issue could arise if a theme/plugin defines style variations that are supposed to have a different border-radius. I've not tested it but if I've done my thinking correctly they would show in-canvas with the intended border-radius but the range control would read as if they have the computed radius. I think that could be worked around too but at the moment this is mainly aimed at sparking conversation.
How has this been tested?
Tested in
Wordpress 5.5.1
Types of changes
Non-breaking enhancement
Checklist: