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

> ...or look into its arguments and guess.

That was my point in https://github.com/w3c/csswg-drafts/issues/12513#issuecomment-3107532554.

To summarize the options we have are:

1. Make `light-dark()` return a different value based on its parameters.
2. Add a separate function `light-dark-image()` for images ...
  a) ... and keep `light-dark(<color>, <color>)` for colors.
  b) ... and also add a `light-dark-color()` function for consistency and mark `light-dark(<color>, <color>)` as a deprecated alias to it.
3. Introduce an explicit parameter for the type (with `<color>` as default)

And to be clear, I have a somewhat strong dislike against option 2a due to it introducing an inconsistency in naming. My favorite is 1 (as it reduces cognitive load and is consistent with other functions like `calc()` or `progress()`). I'd be fine with option 3 and could live with 2b.

Given those four options, I think this is ready to be discussed on a call.

Sebastian

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


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

Received on Tuesday, 21 October 2025 20:14:36 UTC