color-scheme

Class Description

scheme-normal

Sets color-scheme to normal, letting the browser choose the rendering scheme.

CSS Rules

.scheme-normal {
  color-scheme: normal;
}

Usage

<element class="scheme-normal" />

Responsive

Prefix .scheme-normal utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:scheme-normal" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="scheme-normal:hover" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="scheme-normal:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before scheme-normal::before" />

<element class="content-after scheme-normal::after" />
.scheme-normal Sets color-scheme to normal, letting the browser choose the rendering scheme.

scheme-dark

Sets color-scheme to dark, hinting the browser to render UI controls with a dark theme.

CSS Rules

.scheme-dark {
  color-scheme: dark;
}

Usage

<element class="scheme-dark" />

Responsive

Prefix .scheme-dark utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:scheme-dark" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="scheme-dark:hover" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="scheme-dark:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before scheme-dark::before" />

<element class="content-after scheme-dark::after" />
.scheme-dark Sets color-scheme to dark, hinting the browser to render UI controls with a dark theme.

scheme-light

Sets color-scheme to light, hinting the browser to render UI controls with a light theme.

CSS Rules

.scheme-light {
  color-scheme: light;
}

Usage

<element class="scheme-light" />

Responsive

Prefix .scheme-light utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:scheme-light" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="scheme-light:hover" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="scheme-light:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before scheme-light::before" />

<element class="content-after scheme-light::after" />
.scheme-light Sets color-scheme to light, hinting the browser to render UI controls with a light theme.

scheme-light-dark

Sets color-scheme to light dark, allowing the browser to pick either scheme.

CSS Rules

.scheme-light-dark {
  color-scheme: light dark;
}

Usage

<element class="scheme-light-dark" />

Responsive

Prefix .scheme-light-dark utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:scheme-light-dark" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="scheme-light-dark:hover" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="scheme-light-dark:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before scheme-light-dark::before" />

<element class="content-after scheme-light-dark::after" />
.scheme-light-dark Sets color-scheme to light dark, allowing the browser to pick either scheme.

scheme-only-dark

Sets color-scheme to only dark, forcing the dark rendering scheme.

CSS Rules

.scheme-only-dark {
  color-scheme: only dark;
}

Usage

<element class="scheme-only-dark" />

Responsive

Prefix .scheme-only-dark utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:scheme-only-dark" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="scheme-only-dark:hover" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="scheme-only-dark:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before scheme-only-dark::before" />

<element class="content-after scheme-only-dark::after" />
.scheme-only-dark Sets color-scheme to only dark, forcing the dark rendering scheme.

scheme-only-light

Sets color-scheme to only light, forcing the light rendering scheme.

CSS Rules

.scheme-only-light {
  color-scheme: only light;
}

Usage

<element class="scheme-only-light" />

Responsive

Prefix .scheme-only-light utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:scheme-only-light" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="scheme-only-light:hover" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="scheme-only-light:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before scheme-only-light::before" />

<element class="content-after scheme-only-light::after" />
.scheme-only-light Sets color-scheme to only light, forcing the light rendering scheme.