-
Notifications
You must be signed in to change notification settings - Fork 14
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
Support variables #11
Comments
Interesting! So there are two types of variables I can see could be implemented. Compile time variablesThose are only available at compile time (like LESS/SASS variables). We can get the for free by using some PostCSS plugin or by using LESS/SASS directly. So there's not much work to be done here, we need just to document how to insert PostCSS plugins in the pipeline or how to use LESS/SASS with react-css-components Runtime variablesThose are more interesting. Basically we want some styles be influenced by variables supplied in runtime. That means that we need to split some styles from being statically compiled into CSS to styles set via Your example:
show probably exactly that usage scenarios for variables, right? I'd go with a more standard syntax though:
Then usage:
The issues with that approach are:
|
yep, or instead of "prop" could use "var" which is following https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables maybe a radium like approach to inject an actual |
I'm also interested in this feature, at least in For now it would be great to be able to do smth like this:
(but I have no idea how to implement this myself) |
@vyorkin compile time variables are already supported via sass/less/stylus or postcss. See the example with sass: https://github.com/andreypopp/react-css-components/tree/master/examples/sass |
Two observations:
This library seems to be so much better than |
Yep! See examples, you can use any postcss plugin with it. Just add postcss-loader. |
This looks great, any plans for variable support?
or
The text was updated successfully, but these errors were encountered: