# light-dark()

*noun*

say it: **“LYTE DARK”** **/laɪt dɑːrk/**

A CSS function that holds two colors in one value, the first for the light theme and the second for the dark theme. The page's color-scheme decides which one shows.

## What does `light-dark()` do?

`light-dark()` holds two colors in one value: the first for the light theme and the second for the dark theme. The browser picks one from the page's `color-scheme`, so it only works once `color-scheme` is set.

```css
:root { color-scheme: light dark; }
body {
  color: light-dark(#222222, #eeeeee);
  background: light-dark(#ffffff, #121212);
}
```

## In a sentence

- “With **light-dark()**, the card background is white in light mode and charcoal in dark mode, from a single line.”

Level: Journeyman · [More CSS terms at this level](https://www.ask-codey.com/glossary?category=css&level=3)

Updated: November 9, 2026

Source: https://www.ask-codey.com/glossary/light-dark
