Home / File/ candidate.ts — tailwindcss Source File

candidate.ts — tailwindcss Source File

Architecture documentation for candidate.ts, a typescript file in the tailwindcss codebase. 13 imports, 20 dependents.

File typescript OxideEngine PreProcessors 13 imports 20 dependents 18 functions

Entity Profile

Dependency Diagram

graph LR
  669e6a28_c71f_3c5e_9c53_915cede7da78["candidate.ts"]
  7fd72d4c_e95c_d849_1002_1e1c9d8aca1a["design-system.ts"]
  669e6a28_c71f_3c5e_9c53_915cede7da78 --> 7fd72d4c_e95c_d849_1002_1e1c9d8aca1a
  e90d9c51_31f0_3175_a861_610a15e277e5["decode-arbitrary-value.ts"]
  669e6a28_c71f_3c5e_9c53_915cede7da78 --> e90d9c51_31f0_3175_a861_610a15e277e5
  2e1adb5d_9a16_16d9_9e0d_e7ef80a3ec69["decodeArbitraryValue"]
  669e6a28_c71f_3c5e_9c53_915cede7da78 --> 2e1adb5d_9a16_16d9_9e0d_e7ef80a3ec69
  c056448b_f7a2_9149_54e8_f0f8470fe3aa["default-map.ts"]
  669e6a28_c71f_3c5e_9c53_915cede7da78 --> c056448b_f7a2_9149_54e8_f0f8470fe3aa
  bf2992f6_4a37_8536_70f8_94b13631027d["DefaultMap"]
  669e6a28_c71f_3c5e_9c53_915cede7da78 --> bf2992f6_4a37_8536_70f8_94b13631027d
  412cf613_647f_106c_8e3c_028b7fc06b26["is-valid-arbitrary.ts"]
  669e6a28_c71f_3c5e_9c53_915cede7da78 --> 412cf613_647f_106c_8e3c_028b7fc06b26
  872c3879_82c7_fd6e_ce14_258e27bc4877["isValidArbitrary"]
  669e6a28_c71f_3c5e_9c53_915cede7da78 --> 872c3879_82c7_fd6e_ce14_258e27bc4877
  ef204000_8998_5a6c_5455_324b37624713["segment.ts"]
  669e6a28_c71f_3c5e_9c53_915cede7da78 --> ef204000_8998_5a6c_5455_324b37624713
  f712ed47_45d4_4e5a_dd73_fdefa1da71da["segment"]
  669e6a28_c71f_3c5e_9c53_915cede7da78 --> f712ed47_45d4_4e5a_dd73_fdefa1da71da
  1d3f1613_f144_938f_08f7_49039a46ad49["value-parser.ts"]
  669e6a28_c71f_3c5e_9c53_915cede7da78 --> 1d3f1613_f144_938f_08f7_49039a46ad49
  d1b39b63_c9d5_6c28_0206_0ddc8b895876["walk.ts"]
  669e6a28_c71f_3c5e_9c53_915cede7da78 --> d1b39b63_c9d5_6c28_0206_0ddc8b895876
  ed78da58_8727_ad98_120c_61f35cea357a["walk"]
  669e6a28_c71f_3c5e_9c53_915cede7da78 --> ed78da58_8727_ad98_120c_61f35cea357a
  7b34c369_d799_30f1_b751_6e3fd5349f6b["WalkAction"]
  669e6a28_c71f_3c5e_9c53_915cede7da78 --> 7b34c369_d799_30f1_b751_6e3fd5349f6b
  6818f003_fa74_ca6e_8dd1_99a7154be5c9["candidates.ts"]
  6818f003_fa74_ca6e_8dd1_99a7154be5c9 --> 669e6a28_c71f_3c5e_9c53_915cede7da78
  style 669e6a28_c71f_3c5e_9c53_915cede7da78 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type { DesignSystem } from './design-system'
import { decodeArbitraryValue } from './utils/decode-arbitrary-value'
import { DefaultMap } from './utils/default-map'
import { isValidArbitrary } from './utils/is-valid-arbitrary'
import { segment } from './utils/segment'
import * as ValueParser from './value-parser'
import { walk, WalkAction } from './walk'

const COLON = 0x3a
const DASH = 0x2d
const LOWER_A = 0x61
const LOWER_Z = 0x7a
const IS_VALID_NAMED_VALUE = /^[a-zA-Z0-9_.%-]+$/

export type ArbitraryUtilityValue = {
  kind: 'arbitrary'

  /**
   * ```
   * bg-[color:var(--my-color)]
   *     ^^^^^
   *
   * bg-(color:--my-color)
   *     ^^^^^
   * ```
   */
  dataType: string | null

  /**
   * ```
   * bg-[#0088cc]
   *     ^^^^^^^
   *
   * bg-[var(--my_variable)]
   *     ^^^^^^^^^^^^^^^^^^
   *
   * bg-(--my_variable)
   *     ^^^^^^^^^^^^^^
   * ```
   */
  value: string
}

export type NamedUtilityValue = {
  kind: 'named'

  /**
   * ```
   * bg-red-500
   *    ^^^^^^^
   *
   * w-1/2
   *   ^
   * ```
   */
  value: string

  /**
   * ```
   * w-1/2
// ... (1119 more lines)

Domain

Subdomains

Frequently Asked Questions

What does candidate.ts do?
candidate.ts is a source file in the tailwindcss codebase, written in typescript. It belongs to the OxideEngine domain, PreProcessors subdomain.
What functions are defined in candidate.ts?
candidate.ts defines 18 function(s): cloneCandidate, cloneVariant, escapeUnderscore, findRoots, isVar, isVarCache, never, parseCandidate, parseModifier, parseVariant, and 8 more.
What does candidate.ts depend on?
candidate.ts imports 13 module(s): DefaultMap, WalkAction, decode-arbitrary-value.ts, decodeArbitraryValue, default-map.ts, design-system.ts, is-valid-arbitrary.ts, isValidArbitrary, and 5 more.
What files import candidate.ts?
candidate.ts is imported by 20 file(s): candidate.bench.ts, candidates.ts, canonicalize-candidates.ts, compile.ts, default-theme.ts, design-system.ts, is-safe-migration.ts, migrate-arbitrary-variants.ts, and 12 more.
Where is candidate.ts in the architecture?
candidate.ts is located at packages/tailwindcss/src/candidate.ts (domain: OxideEngine, subdomain: PreProcessors, directory: packages/tailwindcss/src).

Analyze Your Own Codebase

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

Try Supermodel Free