# prefers-color-scheme

*noun*

say it: **“prih-FURZ KUL-er SKEEM”** **/prɪˈfɜːrz ˈkʌlər skiːm/**

A CSS media feature that checks whether the person has set their device to a light or a dark theme, so a page can match it.

## What does `prefers-color-scheme` do?

`prefers-color-scheme` checks whether the user has chosen a light or dark theme on their device.

```css
@media (prefers-color-scheme: dark) {
  body { background: #121212; color: #eee; }
}
```

## In a sentence

- “With a **prefers-color-scheme** query, the playlist page turns dark at night when my phone does.”

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/prefers-color-scheme
