← Back to context

Comment by akersten

15 hours 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.

The 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