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
  a05dd615_5873_e63c_0e7c_63a2f2590a7f["DarkModeStrategy"]
  c1272aed_91bb_73df_0746_d55fa9b302fd["types.ts"]
  a05dd615_5873_e63c_0e7c_63a2f2590a7f -->|defined in| c1272aed_91bb_73df_0746_d55fa9b302fd
  style a05dd615_5873_e63c_0e7c_63a2f2590a7f 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