color-scheme

The color-scheme CSS property allows an element to indicate the color schemes with which it is designed to be rendered.

Syntax

CSS

color-scheme: value;

JS

object.style.colorScheme = "value";

Values

<'color-scheme'> = normal | [ light | dark | <custom-ident> ]+ && only?
normal

Specifies the element doesn't support color schemes and the element should be rendered with the browser's default color scheme.

light

Specifies the element supports a light color scheme.

dark

Specifies the element supports a dark color scheme.

<custom-ident>

Specifies any valid identifier that is not misinterpreted as a keyword.

only

Forbids the user agent from overriding the color scheme for the element.

Initial

normal

Examples

dark

light

normal

JS

JS

World Wide Web Consortium (W3C)

Home Menu