ColorModeStrategy

An enum indicating how Silk will register color mode aware styles.

A site will only use one strategy for its entire lifetime, which is determined by the environment it is running in:

  • If the browser does not support the CSS @scope rule, the SUFFIX strategy is used.

  • If the site is currently being exported, the BOTH strategy is used.

  • Otherwise, the SCOPE strategy is used.

See current for the current strategy being used by the site.

Entries

Link copied to clipboard

Color mode aware styles are registered using the CSS @scope rule.

Link copied to clipboard

Color mode aware styles are registered using _light and _dark suffixes.

Link copied to clipboard

Color mode aware styles are registered using both the CSS @scope rule and _light/_dark suffixes.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Indicates whether color mode aware styles should be registered using the CSS @scope rule.

Link copied to clipboard

Indicates whether color mode aware styles should be registered using _light and _dark suffixes.

Functions

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.