descartes
descartes copied to clipboard
Non-JS fallback
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.
@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.
@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.