Home / Type/ Candidate Type — tailwindcss Architecture

Candidate Type — tailwindcss Architecture

Architecture documentation for the Candidate type/interface in candidate.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  b6027eca_1b3d_1f5e_20b2_b0a1f82966c8["Candidate"]
  669e6a28_c71f_3c5e_9c53_915cede7da78["candidate.ts"]
  b6027eca_1b3d_1f5e_20b2_b0a1f82966c8 -->|defined in| 669e6a28_c71f_3c5e_9c53_915cede7da78
  style b6027eca_1b3d_1f5e_20b2_b0a1f82966c8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/candidate.ts lines 164–218

export type Candidate =
  /**
   * Arbitrary candidates are candidates that register utilities on the fly with
   * a property and a value.
   *
   * E.g.:
   *
   * - `[color:red]`
   * - `[color:red]/50`
   * - `[color:red]/50!`
   */
  | {
      kind: 'arbitrary'
      property: string
      value: string
      modifier: ArbitraryModifier | NamedModifier | null
      variants: Variant[]
      important: boolean
      raw: string
    }

  /**
   * Static candidates are candidates that don't take any arguments.
   *
   * E.g.:
   *
   * - `underline`
   * - `box-border`
   */
  | {
      kind: 'static'
      root: string
      variants: Variant[]
      important: boolean
      raw: string
    }

  /**
   * Functional candidates are candidates that can take an argument.
   *
   * E.g.:
   *
   * - `bg-red-500`
   * - `bg-[#0088cc]`
   * - `w-1/2`
   */
  | {
      kind: 'functional'
      root: string
      value: ArbitraryUtilityValue | NamedUtilityValue | null
      modifier: ArbitraryModifier | NamedModifier | null
      variants: Variant[]
      important: boolean
      raw: string
    }

Frequently Asked Questions

What is the Candidate type?
Candidate is a type/interface in the tailwindcss codebase, defined in packages/tailwindcss/src/candidate.ts.
Where is Candidate defined?
Candidate is defined in packages/tailwindcss/src/candidate.ts at line 164.

Analyze Your Own Codebase

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

Try Supermodel Free