I'm recreating my with and I may add some small for the theme switch. My thinking is JS itself is fine; but it depends what you choose to use it for. The issue of course is visitors not being able to use this switch while blocking JS with add-ons such as and (like myself)... May need to take the safer route with pure . Suggestions welcome.

@syntax I'd suggest using `prefers-color-scheme` in CSS to switch between dark and light mode. Use JS for a manual override.
I personally don't mind a bit of JS to enhance functionality, as long as you're not loading multiple MBs of it and doing lots of client side rendering

@aymm Good idea. I would only introduce JS into my site if it was better for the theme switch. I have no other reason to use it (my site is a simple static site for my writing etc.).

@syntax Any tips for a static site? I've been toying with the idea too, but Jenkyl seems waay overkill over what I need so my next thought was to write my own system.

Sign in to participate in the conversation
Mastodon 🔐 privacytools.io

Fast, secure and up-to-date instance. PrivacyTools provides knowledge and tools to protect your privacy against global mass surveillance.

Website: privacytools.io
Matrix Chat: chat.privacytools.io
Support us on OpenCollective, many contributions are tax deductible!