new_blog/posts/platonically-ideal-light-dark-toggle.md

892 B

title description date draft tags
Making a platonically ideal light/dark theme toggle on the web 2025-08-20 true

Many blogs and other sites have a way to toggle between their light and dark themes. However many of these toggles are... not ideal, making various tradeoffs. So I thought it'd be interesting to explore these tradeoffs and throw my own hat into the ring with a potentially better solution.

What Does it Mean to be Ideal?

The Obvious Way

demo

The obvious way to attempt a toggle between light and dark mode is

A Suboptimal Solution

A trick from from

demo

An Ideal Stateless Toggle

demo

An ideal solution