This is really cool! I saw your responsive library[0] post [1] the other day, but couldn't quite wrap my head around it.<p>With this post, I think I am starting to grok the (Space Toggle) trick. The Tweet you linked in your library was really helpful [2].<p>My current understanding is – in CSS, you can set a variable to nothing (a space). When a property contains that "blank" variable, it is replaced by nothing and so the second, "fallback" value is the default. Because you can update CSS variables within more specific or later CSS, you can update the "blank" variable and give it a new value of "initial", this causes it to switch from the default to the defined override.<p>I realized, you can even combine this with the CSS checkbox hack. I made a (super hacky) version of CSS-only dark mode toggle based on your JSBin (gotta love an absolute positioned bg, lol) [3]<p>[0] <a href="https://propjockey.github.io/css-media-vars/" rel="nofollow">https://propjockey.github.io/css-media-vars/</a>
[1] <a href="https://news.ycombinator.com/item?id=23865900" rel="nofollow">https://news.ycombinator.com/item?id=23865900</a>
[2] <a href="https://twitter.com/James0x57/status/1283596399196680192/photo/1" rel="nofollow">https://twitter.com/James0x57/status/1283596399196680192/pho...</a>
[3] <a href="https://jsbin.com/xelufoyoka/1/edit" rel="nofollow">https://jsbin.com/xelufoyoka/1/edit</a>