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

> > There is no precedent for this in CSS
> 
> It's quite similar to how several of the math functions behave. It would make it a bit more complicated on the implementation side, but IMO it's nicer to have a small number of more versatile functions. I'm not much of a web dev these days but I'd expect that to be nicer for authors too.

Absolutely, that's what the [PoC](https://www.w3.org/TR/design-principles/#priority-of-constituencies) is all about. Some complexity on the implementation side to avoid user-facing complexity is usually a desirable tradeoff (but of course it depends on the ratio: _how much_ implementation complexity are we adding vs _how much_ author complexity are we saving?).

In general, from what I've observed, authors _really_ struggle with anything typed in CSS, so the fewer such warts we can have, the better. We shouldn't just be reaching for `*-calc()` and `*-image()` etc to make our lives easier, but only after we've exhausted alternatives.

-- 
GitHub Notification of comment by LeaVerou
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12513#issuecomment-3109226382 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:56:36 UTC