Skip to content
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

Button Block: use computed style to set default border-radius #25720

Closed

Conversation

stokesman
Copy link
Contributor

@stokesman stokesman commented Sep 30, 2020

Taking a stab at #17596, this employs getComputedStyle to define the default border-radius for buttons.

In a theme with square buttons:
button-intial-radius-0

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):
button-intial-radius

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:

  • My code is tested.
  • My code follows the WordPress code style.
  • [n/a] My code follows the accessibility standards.
  • My code has proper inline documentation.
  • [n/a] I've included developer documentation if appropriate.
  • [?] I've updated all React Native files affected by any refactorings/renamings in this PR.

@stokesman
Copy link
Contributor Author

Closing in favor of #29193

@stokesman stokesman closed this Feb 22, 2021
@stokesman stokesman deleted the try/button-computed-radius branch February 22, 2021 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Buttons Affects the Buttons Block
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants