-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
Preprocess CSS using Stylis #26
Conversation
That looks amazing! 😍 One note: the |
e207cd1
to
98b0706
Compare
Is this done?! |
@mxstbr It's a bit rough around the edges :) The |
@mxstbr The last commit adds the missing stuff for the keyframes, so this is complete, if we go by the original to-do list 🎉 I'm treading carefully here, because I spotted another limitation: You won't be able to add new rulesets inside your styled template strings, since it won't be flattened... That was something we spotted earlier, but we need to resolve it now, I guess. To solve this, all interpolation-rulesets need to be wrapped in If we want to resolve the If we want to do this at compile-time, we would recursively go through all |
Unfortunately, babel-plugin-fu have limits. It will not help to flatten css interpolation if it is imported from another file.
Also, I want to ask if you considered conditionally applied rulesets? Something like.
|
@vdanchenkov Exactly these two things are the ones I'm concerned about. That's where we gotta bring the magic to runtime ^^ |
03a5cf1
to
ed0e3bf
Compare
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.
This seems great, I think it'd be a good idea to get it out behind a flag of some sort and get it running on real-world projects.
e84ad42
to
a2e4554
Compare
Since this is now behind a default-false flag and has an "experimental" note, I guess we can ship it |
@mxstbr I can't wait to test this out! npm publish? |
Test suite fails locally, so Ican't publish 😕 |
styled-components
to consumeWrite preprocessor that works for(They should actually "just work™")css
andkeyframes
Disable minification when preprocessing is on(Separate PR)keyframes
helperThis adds the transpilation step that preprocesses CSS, which is then accepted in styled-components under a new entrypoint. An open PR for accepting the preprocessed CSS is here: styled-components/styled-components#585