CSS has just added an image form of light-dark(). So as well as choosing between a pair of colors based on light or dark mode, you can also choose between a pair of images.
No you can't mix them because parsing would be hard.
#CSS
CSS has just added an image form of light-dark(). So as well as choosing between a pair of colors based on light or dark mode, you can also choose between a pair of images.
No you can't mix them because parsing would be hard.
#CSS
@svgeesus Great to see more progress on this feature.
Does this only include `url()` images or could we use gradients? I don't have a use-case in mind, but I could imagine a two-stop gradient in light mode, and three-stop gradient in dark mode, for example, where inlining `light-dark()` for each colour stop wouldn't work.
@chriskirknielsen Any <image>.
The corresponding edit to CSS Images 4 has not yet been made, but will be soon.
@chriskirknielsen It will get added here: