← TechnologyThe essentials of

prefers-color-scheme: initial theme according to the system

Publisher: ResumeMaker • 1 source

Published: 22 Oct 2026 13:13 · Updated: 22 Oct 2026 13:13

AI source check: 21 Oct 2026 10:36. This is not editorial approval.

In a few sentences

In brief

A light or dark system theme can be a starting point for the site's colors.

Useful to know

With the media application prefers-color-scheme, the site can report a preferred light or dark color scheme. The @media (prefers-color-scheme: dark) example applies certain styles when a dark scheme is requested. This is a presentation preference, not room lighting information. [1]

A practical approach is to define color variables for background, text, frames and links, and in the query to change their values. So the same structure can get a different palette without copying the whole CSS.

Check the forms, logos, photos, and focus states in both schemas. Inverting the colors of the entire page is rarely enough for a consistent result. If it has its own theme button, the human-selected mode should have a clear relationship with the system preference, instead of the two settings fighting each other.

Sources

For further detail and to check the information:

  1. [1] MDN — prefers-color-scheme ↗