Server Side Rendering Compatible CSS Theming
Published 📅: ....
Last modified 📝: ....
Share this post on BlueskySee discussion on Bluesky
Earlier today I saw some discussion around how to implement light/dark mode theming for a server side rendered (SSR) React application, in this case it was using Waku, however this pattern is compatible with almost any modern React framework, e.g. Next.js, React Router, etc!
I quickly worked up a , but I figured I could expand on it a bit and outline what it does and how it works in more details. If you're just looking for the snippets of code - I recommend jumping to that demo where you can easily copy them!