Re: [csswg-drafts] [css-images-4] Add `light-dark-image()`, or generalize `light-dark()` for images too? (#12513)

> I'd like to know if it's possible to support mixed syntax like `light-dark(<color>, <image>)`.

No, as this would lead to parsing issues. We need to be very specific _where_ the `light-dark()` with colors and the `light-dark()` with images is used. See https://github.com/w3c/csswg-drafts/issues/12513#issuecomment-4085662455 for the proposed syntax details.

Practical example being `background: red light-dark(blue, url(dark.png));`. With a dark color-scheme that would be OK, but in a `light` color-scheme you’d end up with `background: red blue` which is invalid.


-- 
GitHub Notification of comment by bramus
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12513#issuecomment-4090038150 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 19 March 2026 13:11:59 UTC