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
RadioControl: Fully encapsulate styles #57347
Conversation
Size Change: +112 B (0%) Total Size: 1.69 MB
ℹ️ View Unchanged
|
Flaky tests detected in 5b7f662. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7301615837
|
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.
Changes look good and test well 🚀
Should we tweak the UI to use theme variables for things like label text color, radio borders, etc?
Eventually, yes! Ideally I'd like to do a handful of components at once to make whatever approach we take is sustainable/scalable. |
Fixes #50428
Fixes #26293
What?
Fully encapsulates the styles required for RadioControl so that it looks like it does in a WordPress context.
Why?
RadioControl had several stylistic issues, including not reflecting the components theme color (#50428), and having weird focus styles in Firefox (#26293). In fact, RadioControl in isolation (e.g. in Storybook) looked quite different from when rendered inside the Gutenberg editor, which was actually the correct design.
This was due to a lot of the necessary styles being provided through the
forms.css
stylesheet that is loaded globally in WordPress contexts.How?
Adds the necessary styles so it looks correct regardless of whether
forms.css
is loaded.Testing Instructions
See the RadioControl story in Storybook.
It should look the same as when
forms.css
is loaded.Component theme colors should apply correctly.
CleanShot.2023-12-23.at.00.42.58-converted.mp4
Screenshots or screencast