3 ms·
The author had a specific desire for a toggle on a static site, which requires a bit of persistent state that CSS can't really capture. (FWIW, I don't care for
by saagarjha 7y ago
The author had a specific desire for a toggle on a static site, which requires a bit of persistent state that CSS can't really capture. (FWIW, I don't care for a toggle and match the system theme on my website as well. But dismissing the author's work with your "few lines of CSS" fails to account for the fact that this dark mode does something different than yours.)
- memco 7y agoThis doesn't capture all the state correctly even. When you first load the page, if it is dark mode the XKCD loads a black on white (aka light) image. If you toggle to light mode and back to dark the XKCD comic becomes a black on white image. The state of image filters isn't consistent in the current implementation.
- saagarjha 7y agoOh, I'm not claiming it does it correctly. (In fact, I have another comment that points out another issue: https://news.ycombinator.com/item?id=22924571 https://news.ycombinator.com/item?id=22924571). But the claim that I was responding to made incorrect assumptions, and the bugs in the implementation don't change that.