I think it’s wrong, that light-dark()
in CSS only works with colors.
When the decision was made to add syntactic sugar for (prefers-color-scheme: dark)
, which allows passing different values at the point of definition, why did they choose to only allow it for colors?
This breaks the shorthand for common use cases like changing the background-image
based on the color scheme. And that also means, that we cannot use light-dark()
in combination with gradients. I’ve refactored the CSS on my website to use it, but I’m disappointed, that its use case is very limited.