3 ms·
kind of sad that the CSS specification wound up with this clunky `light-dark(white,black)` thing instead of literally anything more extensible like, `themed(dar
by akersten 6mo ago
kind of sad that the CSS specification wound up with this clunky `light-dark(white,black)` thing instead of literally anything more extensible like, `themed(dark(black), light(white), retro(purple))`.
Then you'd be able to have a cool theme dropdown like sites used to have, fully CSS-driven with essentially no JS required, in a compatible and modern way.
- ChrisMarshallNY 6mo agoLike the xkcd one? https://xkcd.com https://xkcd.com Not sure if it shows up for everyone, but there was a popover under the comic that did all kinds of crazy themes.
- 2ndbigbang 6mo agohttps://xkcd.com/3227/ https://xkcd.com/3227/
- ChrisMarshallNY 6mo agoYup. Thanks!
- WorldMaker 6mo agoThe proposers of `light-dark()` themselves recognized that `light-dark()` was presumably a "stepping stone" towards (and then eventually just a shorthand for) a deeper `schemed-value()` function similar to what you are asking for, once CSS also picked up a way to define custom color schemes. (Often proposed as an `@color-scheme` rule or block.) It can be an interesting discussion to follow: https://github.com/w3c/csswg-drafts/issues/9660 https://github.com/w3c/csswg-drafts/issues/9660
- Zak 6mo agoIt breaks the zero one infinity rule by supporting an arbitrarily limited number of themes: exactly two. https://en.wikipedia.org/wiki/Zero_one_infinity_rule https://en.wikipedia.org/wiki/Zero_one_infinity_rule