JonHMChan / descartes

Descartes | Write CSS in JavaScript
https://descartes.io/slides
MIT License
444 stars 21 forks source link

Non-JS fallback #33

Open jeremykohn opened 8 years ago

jeremykohn commented 8 years ago

If a web page's styles are all set by Descartes, what happens when JavaScript is disabled? Does the user just see unstyled text?

It seems to me that static styles could be generated server-side as a fallback for browsers that do not (or cannot) have JavaScript turned on.

JonHMChan commented 8 years ago

@jeremykohn currently there's no fallback, but that's the active discussion right now here: https://github.com/JonHMChan/descartes/issues/26. It's actually a good idea to generate a CSS fallback for performance reasons as well as no-JS scenarios.

JonHMChan commented 7 years ago

@jeremykohn you'll be interested to see that https://github.com/JonHMChan/descartes/blob/master/src/descartes.js#L441 has been implemented to generate a CSS fallback based on what's typically calculated from the core library. The only thing that may be missing are styles based on event listeners (basically may mean generating JS) but generally, it's a good fallback for initial loading.