Home / Type/ DarkModeStrategy Type — tailwindcss Architecture

DarkModeStrategy Type — tailwindcss Architecture

Architecture documentation for the DarkModeStrategy type/interface in types.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  fd6981c3_ce10_1269_aef3_2469b89bac14["DarkModeStrategy"]
  479eaf18_f640_94ff_bd07_456688f9ac14["types.ts"]
  fd6981c3_ce10_1269_aef3_2469b89bac14 -->|defined in| 479eaf18_f640_94ff_bd07_456688f9ac14
  style fd6981c3_ce10_1269_aef3_2469b89bac14 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/compat/config/types.ts lines 42–63

type DarkModeStrategy =
  // No dark mode support
  | false

  // Use the `media` query strategy.
  | 'media'

  // Use the `class` strategy, which requires a `.dark` class on the `html`.
  | 'class'

  // Use the `class` strategy with a custom class instead of `.dark`.
  | ['class', string]

  // Use the `selector` strategy — same as `class` but uses `:where()` for more predictable behavior
  | 'selector'

  // Use the `selector` strategy with a custom selector instead of `.dark`.
  | ['selector', string]

  // Use the `variant` strategy, which allows you to completely customize the selector
  // It takes a string or an array of strings, which are passed directly to `addVariant()`
  | ['variant', string | string[]]

Frequently Asked Questions

What is the DarkModeStrategy type?
DarkModeStrategy is a type/interface in the tailwindcss codebase, defined in packages/tailwindcss/src/compat/config/types.ts.
Where is DarkModeStrategy defined?
DarkModeStrategy is defined in packages/tailwindcss/src/compat/config/types.ts at line 42.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free