←back to thread

451 points todsacerdoti | 1 comments | | HN request time: 0s | source
Show context
sbinnee ◴[] No.45060391[source]
I always knew that there should be a way to have a button to change light and dark mode on my website without javascript. But I couldn’t figure it out (pre llm era) and gave up and just used javascript. Now it’s time to make an update on that. This blog motivated me.
replies(3): >>45060405 #>>45060700 #>>45062138 #
masklinn ◴[] No.45060700[source]
It’s nice but probably not that useful as you still need JS to persist the setting.

For testing there are extensions which allow overriding the browser’s scheme (for Firefox anyway).

replies(2): >>45061637 #>>45067531 #
1. wjrb ◴[] No.45067531[source]
DevTools in Firefox and Chrome both have a `prefers-color-scheme` override built in, no extension required.