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

> > And if we go down that route, I wonder if we can just make the type a parameter, since there's precedent for that…
> 
> I wonder if we actually need that. Depending on the given parameters and context in which the function is used its return type should be clear. 

Not really, there are cases where all three types are valid, e.g. `background`. Though we _could_ require that the type of both arguments is the same, then disambiguation can still work by simply looking at the type of the first argument, and making it a parse error if they are not the same.

There is no precedent for this in CSS, and I haven't thought it through very much, but it does seem like a pretty elegant solution.

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


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

Received on Wednesday, 23 July 2025 15:19:40 UTC