Light and Dark Themes with prefers-color-scheme

A dark theme is the same page with new token values: you redefine the color tokens in a prefers-color-scheme media query, set color-scheme, and every component follows the reader's light or dark setting.

Updated

Cheat sheet: Light and Dark Themes with prefers-color-scheme
Category
CSS
Level
Journeyman
Tags
:has(), checked, color-scheme, CSS, light-dark(), prefers-color-scheme