{
 "compat_features": [
  "css.types.color.light-dark.image_value"
 ],
 "description": "The light-dark() CSS function accepts, in addition to colors, two <image> values, such as a gradient or URL, and uses one depending on the current color scheme.",
 "description_html": "The <code>light-dark()</code> CSS function accepts, in addition to colors, two <code>&#x3C;image></code> values, such as a gradient or URL, and uses one depending on the current color scheme.",
 "kind": "feature",
 "name": "light-dark() image values",
 "spec": [
  "https://drafts.csswg.org/css-color-5/#typedef-light-dark-image"
 ],
 "status": {
  "baseline": "low",
  "baseline_low_date": "2026-09-14",
  "by_compat_key": {
   "css.types.color.light-dark.image_value": {
    "baseline": "low",
    "baseline_low_date": "2026-09-14",
    "support": {
     "chrome": "150",
     "chrome_android": "150",
     "edge": "150",
     "firefox": "150",
     "firefox_android": "150",
     "safari": "27",
     "safari_ios": "27"
    }
   }
  },
  "support": {
   "chrome": "150",
   "chrome_android": "150",
   "edge": "150",
   "firefox": "150",
   "firefox_android": "150",
   "safari": "27",
   "safari_ios": "27"
  }
 },
 "id": "light-dark-image",
 "groups": [],
 "specs": [
  {
   "url": "https://drafts.csswg.org/css-color-5/#typedef-light-dark-image",
   "seriesComposition": "delta",
   "shortname": "css-color-5",
   "series": {
    "shortname": "css-color",
    "currentSpecification": "css-color-4",
    "title": "CSS Color",
    "shortTitle": "CSS Color",
    "releaseUrl": "https://www.w3.org/TR/css-color/",
    "nightlyUrl": "https://drafts.csswg.org/css-color/"
   },
   "seriesVersion": "5",
   "seriesPrevious": "css-color-4",
   "seriesNext": "css-color-6",
   "organization": "W3C",
   "groups": [
    {
     "name": "Cascading Style Sheets (CSS) Working Group",
     "url": "https://www.w3.org/groups/wg/css/"
    }
   ],
   "release": {
    "url": "https://www.w3.org/TR/css-color-5/",
    "status": "Working Draft",
    "filename": "Overview.html"
   },
   "nightly": {
    "url": "https://drafts.csswg.org/css-color-5/",
    "status": "Editor's Draft",
    "alternateUrls": [
     "https://w3c.github.io/csswg-drafts/css-color-5/"
    ],
    "repository": "https://github.com/w3c/csswg-drafts",
    "sourcePath": "css-color-5/Overview.bs",
    "filename": "index.html"
   },
   "title": "CSS Color Module Level 5",
   "source": "w3c",
   "shortTitle": "CSS Color 5",
   "categories": [
    "browser"
   ],
   "standing": "good",
   "tests": {
    "repository": "https://github.com/web-platform-tests/wpt",
    "testPaths": [
     "css/css-color"
    ]
   },
   "fragment": "typedef-light-dark-image"
  }
 ],
 "mdnUrls": [],
 "standardPositions": [],
 "hasNegativeStandardPosition": false,
 "stateOfSurveys": [],
 "chromeUseCounters": {},
 "interop": [],
 "wpt": null,
 "developerSignals": null,
 "bugs": {
  "safari": [
   "https://webkit.org/b/309689"
  ],
  "safari_ios": [
   "https://webkit.org/b/309689"
  ]
 },
 "useCases": [
  {
   "description": "- Use different images/photos/illustrations that are tuned for the corresponding mode.\n- Use an alternative version of the logo, for example, Datadog logo has a strict guidelines where on dark backgrounds it must use a different shape: https://www.datadoghq.com/about/resources/\n- Adjusting icons/images to have a better contrast with the inverted background while keeping the same color (adding outlines, shadows, or something else that makes the image stand out against an otherwise similarly-bright background)\n\nWhile these could be adjusted with media queries, often a page could have sections that has inverted colors (navigation menus, sidebars, etc), and any image inside will need to be adjusted based on the `color-scheme` used on the container.\n\n<details>\n\n<summary>Aside from images, I also want to use it with any CSS properties and values.</summary>\n\n(hiding in the details, as I originally misread the topic to consider all the `light-dark()` use cases and not just images, haha)\n\nUse cases that I saw in the wild:\n\n- Adjusting the `filter` property — making things ligher/darker, adjusting contrast and saturation, etc. Same for `mix-blend-mode`, `background-blend-mode` and other similar properties.\n- Optical adjustments via `transform` or adjusting the width of borders/shadows.\n- Changing the `opacity` of something (often, also for optical/brightness adjustments).\n- Adjusting the presence/size/spread of some box or text shadow.\n- `display` value, like when you need to show a specific image or element for the corresponding color scheme (we can do responsive images based on media queries, but not on a component-level `color-scheme`, and sometimes you want to change the copy or something else too).\n\n</details>",
   "url": "https://github.com/web-platform-dx/developer-signals/issues/568#issuecomment-4418675627"
  },
  {
   "description": "Let's say I have image/ video cards, where the card's **hue** matches what's dominant in the `src` of the `img` element/ `poster` of the `video` element, while the saturation, lightness and alpha are user set.\n\nThe page background and the card text depend on the theme via `light-dark()`.\n\n```\n:root { background: light-dark(#dedede, #212121) }\n\n.card { color: light-dark(#121212, #ededed) }\n```\n\nHowever, depending on the user set lightness and alpha for the card background, the text contrast may be less than ideal. We could have this situation:\n\n![in the dark theme case, when the card text is close to white, user set lightness and alpha are high, resulting in a pretty opaque bright card background, which means poor contrast](https://github.com/user-attachments/assets/f1db6dee-a2f7-4fcb-b230-07f7fa67a74f)\n\nOr this situation:\n\n![in the light theme case, when the card text is close to black, user set lightness is low and alpha is high, resulting in a pretty opaque dark card background, which means poor contrast](https://github.com/user-attachments/assets/cbaa5aba-d63b-4aa6-b928-bbb0fc2857d1)\n\nSince the user set brightness and alpha are stored as numeric values in custom properties, I could use them to compute the proper values inside the `light-dark()` for the card's text `color`... **if** I also have a custom property `--dark` that changes automatically with the theme. Something like this:\n\n```\n:root { --dark: light-dark(0, 1) }\n```",
   "url": "https://github.com/web-platform-dx/developer-signals/issues/568#issuecomment-4439039351"
  }
 ],
 "baselineLowDateAsObject": "2026-09-14T00:00:00.000Z",
 "baselineHighDateAsObject": null,
 "expectedBaselineHighDate": "2029-03-14"
}