-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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: Clean up CSS #43868
RadioControl: Clean up CSS #43868
Conversation
Size Change: -62 B (0%) Total Size: 1.25 MB
ℹ️ View Unchanged
|
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.
🚀
@mirka just wanted to note that this change did break styling for component users that relied on the radio control options being nested directly under the It would make more sense to add styling updates to the |
Hey @louwie17 , unfortunately internal DOM structure and internal classnames are not part of the public API surface of the component. We consider those as implementation details, and therefore we can't guarantee backwards compatibility on those aspects. That's why we actively discourage style overrides on the components (especially the ones relying on internal DOM structure or classnames), since they are particularly prone to breakages when the implementation details of a component change. |
@louwie17 Just to add: Instead, if you let us know what exactly you wanted to achieve with those style overrides, we may be able to improve the component implementation to support that kind of styling in a more robust way. |
@ciampo & @mirka thanks for the responses, we do indeed try to keep the overrides to a minimum where we can, and understand things could change ( as the impact of Gutenberg updates has usually caused very minimal conflicts) I do find this change a slight exception, mostly because the radio buttons have been directly nested since it's conception, and we make use of an experimental component to change that. But anyway, I guess that's just my opinion.
The only suggestion I would make then, is to allow radio control buttons to also be displayed horizontally and not only vertically. |
Exactly! I should have written that as part of my initial response, apologies! We're always open to feedback and we're happy to improve the components when possible!
That sounds reasonable! Could you open a new issue with that request, so that we can discuss the exact specs? |
Thanks, I created a feature request for it here. |
Part of #38730
What?
Clean up the styles in RadioControl so it uses less custom CSS.
Note that this component already had it's margin-bottom removed internally via style overrides 😄 So there's nothing to deprecate here, just cleanup.
Why?
Less code and less overrides. This is also a necessary step to officially deprecate the bottom margin from BaseControl.
How?
__nextHasNoMargin
prop on the BaseControl.Testing Instructions
npm run storybook:dev
and check the RadioControl story. There shouldn't be any visual changes.