yocss icon indicating copy to clipboard operation
yocss copied to clipboard

Support SSR

Open treshugart opened this issue 7 years ago • 0 comments

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.

  1. For React et al, we probably need to renderStatic or something. I'm not 100% sure how this would look yet.
  2. 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 each sheet and output them as <style> content without needing to use a custom API here. This should just work (tm).

treshugart avatar Nov 22 '17 11:11 treshugart