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

Make CircularOptionPicker focus styles resilient to button size changes #54196

Conversation

andrewhayward
Copy link
Contributor

@andrewhayward andrewhayward commented Sep 5, 2023

What?

As per #54156, this PR adjusts the CircularOptionPicker focus ring style so as not to be hardcoded to a specific size.

Why?

CircularOptionPicker focus styles don't account for different option sizes, as they are hard-coded to specific dimensions. This means that any variation in option size isn't accounted for.

How?

This patch updates how the focus ring is styled to make it adaptable for differing control sizes.

Testing Instructions

navigating.to.colour.options.mov

Navigate to the editor styles colour palette:

  1. Appearance
  2. Editor
  3. Styles
  4. Edit styles...
  5. Colours
  6. Palette

Using the keyboard, tab through the various controls until the colour swatch options are highlighted. The focus ring should wrap the swatch, and not look off.

Screenshots or screencast

Before

Five small colour swatches, with labels; one has focus, but the focus ring is offset and too large.

After

Five small colour swatches, with labels; one has focus, as indicated by a ring around it.

Currently the focus ring around `CircularOptionPicker` options is hard-coded to a specific size. This means that any variation in option size isn't accounted for.
This patch updates how the focus ring is styled to make it adapable for differing control sizes.
Copy link
Contributor

@brookewp brookewp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tests well and looks much better! 🎉 This should be good to merge after checks complete and pass.

@brookewp brookewp added [Type] Bug An existing feature does not function as intended [Package] Components /packages/components labels Sep 5, 2023
@brookewp brookewp added this to In progress (owned) ⏳ in WordPress Components via automation Sep 5, 2023
@ciampo ciampo merged commit e4e4845 into WordPress:trunk Sep 6, 2023
51 checks passed
WordPress Components automation moved this from In progress (owned) ⏳ to Done 🎉 Sep 6, 2023
@github-actions github-actions bot added this to the Gutenberg 16.7 milestone Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Bug An existing feature does not function as intended
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants