-
Notifications
You must be signed in to change notification settings - Fork 32
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
csjs.getAllCss : return all CSS by csjs #30
Comments
To do that, csjs would need to be some sort of stateful singleton. I've actually started working on a similar idea as part of a comprehensive, better server-rendering and CSS extraction solution that doesn't have any hard tooling requirements (e.g. a browserify transform or webpack loader). https://github.com/rtsao/styletron Essentially, all that needs to be done is to create a csjs-styletron wrapper, then use that in place of normal csjs. Then when rendering on the server, you will be able to simply pull out all CSS that was generated for the app for that render. This means you can send down just the CSS that is needed for the initial render along with the HTML. Any additional styles rendered later on by the client will simply be automatically injected into The cool thing about this is the styles need not be known at build-time. Instead they are extracted at render time. I'm not sure if this would fit your needs, but I think this is the best way to do server-rendering with CSS-in-JS tools. I need to create a little |
@rtsao this is similar to what I was looking for. But my main concern was actually browser side. If I have all my csjs requiring through to a single app component. I'd love to be able to go csjs.getAllCss, and return the cumulative css of all used csjs in the single bundle.js browser based app. Just not sure how feasible this is, especially if I include modules that use their own csjs modules that I can't override. Secretly I want to create |
Is it important for you to be able to extract static CSS at build-time? If not, |
@rtsao yep, I'm building it with yoyo right now: https://github.com/SilentCicero/yoyo-bootstrap The css I hope to ship with csjs. Right now it's just css includes. I really need to figure out the exporting of csjs modules. That's my main concern right now. The webpack situation is a little dire and hard to figure out. We should work on a solution there. Just working out the specifics with yoyo/dom manipulation. A lot to learn about the dom... =D |
So It would be really great if I could just export all the CSS for the entire app.
Not sure if this is the right approach, but a getAllCss would be awesome.
The text was updated successfully, but these errors were encountered: