I'm recreating my #website with #Sass and I may add some small #JavaScript 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 #NoScript and #uBlockOrigin (like myself)... May need to take the safer route with pure #CSS. Suggestions welcome. #darkmode #webdev #design #coding
@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.).
Or maybe try https://gohugo.io/
(Also what @torproject uses for their site.)