-
Notifications
You must be signed in to change notification settings - Fork 59
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
Dynamic styles in styled() components #730
Comments
Don't believe that's possible. The main way astroturf is different from the Styled Components library is that it has zero runtime, which means all the styles are generated at the build step and not dynamically injected in the DOM during the execution. |
yeah it's not possible right now. It could actually be possible, if we compile the values to css custom properties (like with the css props) but honestly i'm not inclined to make the styled API more robust, i tend to think that it's an inferior API compared to defining your own components with a css prop. |
Good callout @jquense, you can get dynamic styles natively if you use CSS Custom properties, e.g. const Text = styled("span")`
color: var(--color-text);
` That's one appropriate way to do theming in your app, for instance. |
Hi. This is more of a question. I wasn't quite able to tell from the docs; is it possible to do something like the following:
Thanks
The text was updated successfully, but these errors were encountered: