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

feat: added inline variants #333 #334

Merged
merged 1 commit into from
Apr 15, 2022

Conversation

jguddas
Copy link
Contributor

@jguddas jguddas commented Dec 19, 2021

Summary

Example: <x.div color={{ '&:empty': 'red' }}/>

This makes it, so we fall back to &:empty when theme.states['&:empty'] and theme.breakpoints['&:empty'] is not defined,
just like we use red when theme.colors.red is not defined.

Test plan

I added unit tests, if there are more test cases I should take a look at, let me know.
I also tried it out using x from the styled-components package.

@jguddas
Copy link
Contributor Author

jguddas commented Dec 19, 2021

This solves #333

@jguddas
Copy link
Contributor Author

jguddas commented Jan 31, 2022

Did you find the time to have a look at this @gregberge?

@gregberge gregberge merged commit acfa364 into styled-components:main Apr 15, 2022
@gregberge
Copy link
Collaborator

Thanks @jguddas

@jguddas
Copy link
Contributor Author

jguddas commented Apr 15, 2022

Awesome, we have used my version in production for quite some time now and would love to switch back, are you going to create a minor release for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants