-
Notifications
You must be signed in to change notification settings - Fork 673
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
components: Remove style props #2326
base: develop
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 37becf7:
|
@hasparus thoughts on this? |
Looks good to me. I very much appreciate the containerSx prop! |
@lachlanjc I can write a simple codemod if you think it's good to merge. |
That'd be amazing! Definitely my main hesitation. |
We'd mentioned this in #2275 & #832 as part of simplifying our API, as it can lead to confusing CSS ordering & overrides: if I have the same property in a style prop & sx, which wins out? It's especially unclear from a component that's wrapping a Theme UI component. This is a big, breaking change, so it should definitely not be in our MDX release, in case folks don't want to upgrade immediately. Providing a codemod would be great too; I haven't worked on that yet.
Release notes
<Box bg="primary" mt={3}
), in favor of only supporting styling through thesx
prop.Field
component now accepts a secondcontainerSx
prop, intended to replace whitespace style props (e.g. to convert<Field my={3} sx={{ … }}
to<Field containerSx={{ my: 3 }} sx={{ … }}
).Checkbox
,Select
, andSwitch
have this new prop as well.