Come To The Light-dark() Side
October 28, 2024
You’d be forgiven for thinking coding up both a dark and a light mode at once is a lot of work. You have to remember @media queries based on prefers-color-scheme as well as extra complications that arise when letting visitors choose whether they want light or dark mode separately from the OS setting. And let’s not forget the color palette itself! Switching from a “light” mode to a “dark” mode may involve new variations to get the right amount of contrast for an accessible experience.It is indeed a lot of work. But I’m here to tell you it’s now a lot simpler with modern CSS!
Which reminds me, Conffab needs a light mode (and Web Directions needs a dar mode). Might have to get onto that, and it’s much easier thanks to this article from Sara Joy.