diff --git a/files/en-us/web/css/color-scheme/index.md b/files/en-us/web/css/color-scheme/index.md index cc992ea965e4915..3e4b0ee19e15eac 100644 --- a/files/en-us/web/css/color-scheme/index.md +++ b/files/en-us/web/css/color-scheme/index.md @@ -66,6 +66,18 @@ To opt the entire page into the user's color scheme preferences, declare `color- } ``` +To style specific elements based on the user's color scheme preferences, declare `color-scheme` on specific elements. + +```css +header, +footer { + color-scheme: only dark; +} +main { + color-scheme: only light; +} +``` + ### Setting colors based on color scheme To style elements based on color scheme preferences, use the [`prefers-color-scheme`](/en-US/docs/Web/CSS/@media/prefers-color-scheme) media query. The example below opts in elements with a class of `.element` to using both light and dark operating system color schemes via the `color-scheme` property, and then uses `prefers-color-scheme` to specify the desired foreground and background colors for those color schemes.