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

The CSS Working Group just discussed ``[css-images-4] Add `light-dark-image()`, or generalize `light-dark()` for images too?``, and agreed to the following:

* `RESOLVED: Overload light-dark() to accept image pairs`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> TabAtkins: We already have light-dark() for colors, makes it very convenient to write colors inline without indirection<br>
&lt;fantasai> TabAtkins: Similar request for other types of values, but the most important one is images. Identical use case to colors.<br>
&lt;fantasai> TabAtkins: a lot of agreement in the thread that this is a reasonable request<br>
&lt;fantasai> TabAtkins: proposal is that we either augment light-dark() to allow pair of colors OR pair of images, and resolves accordingly<br>
&lt;emilio> q+<br>
&lt;fantasai> TabAtkins: or we add a new function, light-dark-image(), same as light-dark() but accepts images instead<br>
&lt;astearns> q+<br>
&lt;fantasai> TabAtkins: Thread leans towards augmenting light-dark()<br>
&lt;fantasai> TabAtkins: There's further questions about allowint more values than just colors or images<br>
&lt;fantasai> TabAtkins: I prefer to not do that right now<br>
&lt;fantasai> TabAtkins: Partly because it has some parsing complications<br>
&lt;fantasai> TabAtkins: and also, we do have the ability to do that with if()<br>
&lt;fantasai> TabAtkins: and the use cases are rarer<br>
&lt;astearns> ack emilio<br>
&lt;fantasai> TabAtkins: So proposing to allow light-dark() to accept pair of images<br>
&lt;fantasai> emilio: I agree with Tab's proposal<br>
&lt;ydaniv> +1 TabAtkins<br>
&lt;fantasai> emilio: Third alternative is to make it an arbitrary substitution thing, but it makes problems especially for images<br>
&lt;fantasai> emilio: image caches, etc.<br>
&lt;fantasai> emilio: So keeping it simple, and if you want something complicated use if()<br>
&lt;fantasai> emilio: I haven't heard requests for any requests for anything else from FF frontend folks<br>
&lt;fantasai> astearns: So you implemented light-dark(&lt;img>, &lt;img>)?<br>
&lt;fantasai> emilio: yeah<br>
&lt;smfr> q+<br>
&lt;dbaron> Is there any complexity here about url() versus image() ?<br>
&lt;fantasai> astearns: I don't have a strong opinion on which way to go syntactically<br>
&lt;fantasai> astearns: Thinking about other extensions, overloading seems better than creating a new function per type<br>
&lt;fantasai> TabAtkins: If we branch out into more thing, grammar issues become more difficult.<br>
&lt;dbaron> (had to go, past 1pm)<br>
&lt;fantasai> TabAtkins: colors and images are 100% distinct (and should always be), but not doing that rn<br>
&lt;fantasai> TabAtkins: so we can address in the future<br>
&lt;astearns> ack smfr<br>
&lt;fantasai> smfr: People have been talking about URL arguments. Can you nest these?<br>
&lt;fantasai> emilio: Yes<br>
&lt;fantasai> emilio: And you can have the color version inside your gradient<br>
&lt;fantasai> emilio: could even nest that inside the image light-dark<br>
&lt;fantasai> [seems weird but doable]<br>
&lt;fantasai> PROPOSED: Overload light-dark() to accept image pairs<br>
&lt;fantasai> RESOLVED: Overload light-dark() to accept image pairs<br>
</details>


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


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

Received on Wednesday, 11 March 2026 17:03:40 UTC