yocss
yocss copied to clipboard
Support SSR
CSS rules are added using the imperative DOM APIs. Because of that, their content doesn't appear as <style>
content.
There's a couple of different scenarios here.
- For React et al, we probably need to
renderStatic
or something. I'm not 100% sure how this would look yet. - For web components, they'll need a server-side DOM implementation and will need a library to do the serialisation for them, since it's not standardised, so it won't appear in something like JSDOM. For this, the serialisation method could simply just analyse the
cssRules
for eachsheet
and output them as<style>
content without needing to use a custom API here. This should just work (tm).