Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

We are working on a W3C proposal to hopefully improve both the DX and UX of setting dark/light so that developers can avoid hacks around FOUC, doubling up all CSS and needing JS on every page load to check the state.

You can read more about it here: https://github.com/WICG/web-preferences-api

Feedback is welcome



The main thing I feel here is that generally people want the ability to have site specific preferences for dark mode / light mode and this doesn’t seem like it enables that.

Also the problem it’s solving is not that big, it’s literally less than a dozen lines of JS. These “hacks” are exceptionally well documented solutions that exist for about every possible framework or library.

Idk maybe I’ve just built out the solution for it too many times and now I think it’s easy. I am still learning how to better implement the solution, including using inline JS to avoid the color change. But still I have a hard time understanding how moving this logic into the browser would help people.


How about some colour ? Not everybody loves black and white (or dark gray and light gray).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: