i absolutely hate how the modern web just fails to load if one has javascript turned off. i, as a user, should be able to switch off javascript and have the site work exactly as it does with javascript turned on. it’s not a hard concept, people.
but you ask candidates to explain “graceful degradation” and they’ll sit and look at you with a blank stare.
Most don’t even know
@media (prefers-color-scheme: dark/light)
, rather cobble something with JS that works half of the time and needs buttons to toggle.A button to toggle is good design, it should just default to your system preferences.
Took me ages to find a snippet that has a manual dark mode toggle but in a way that works with prefer-color-scheme so by default it inherits your settings but you can overwrite it… It’s just not a priority for a lot of people or they’re ok with the site flashing or something.
Bookmarking this, so far I’ve cobbled my Dark/Light Mode switch together with Material-UI themes, but this seems like the cleaner way to do this that I’ve been searching for!
Also note
prefers-reduced-motion
for accessibility.The thing with this is that many people want to switch their setting to be non default, and it’s impossible to have both user configurable and nice css at the same time. One has to go.
Edit: Oops, just realized I replied to a 2 month old comment. My bad