Home / File/ canonicalize-candidates.ts — tailwindcss Source File

canonicalize-candidates.ts — tailwindcss Source File

Architecture documentation for canonicalize-candidates.ts, a typescript file in the tailwindcss codebase. 44 imports, 4 dependents.

File typescript Oxide Extractor 44 imports 4 dependents 47 functions

Entity Profile

Dependency Diagram

graph LR
  f6c14bbb_2e42_58cc_18f1_c89a243da9c0["canonicalize-candidates.ts"]
  1721da0c_9e1d_5bee_ab0a_a192cfa6640d["apply.ts"]
  f6c14bbb_2e42_58cc_18f1_c89a243da9c0 --> 1721da0c_9e1d_5bee_ab0a_a192cfa6640d
  7ad9d996_c0ff_47f5_d131_ab2ead06506e["substituteAtApply"]
  f6c14bbb_2e42_58cc_18f1_c89a243da9c0 --> 7ad9d996_c0ff_47f5_d131_ab2ead06506e
  b9cbffa4_c352_cf3c_268f_cbb174fb3a47["ast.ts"]
  f6c14bbb_2e42_58cc_18f1_c89a243da9c0 --> b9cbffa4_c352_cf3c_268f_cbb174fb3a47
  2f6881be_62d9_4b96_7331_a962ced095f7["atRule"]
  f6c14bbb_2e42_58cc_18f1_c89a243da9c0 --> 2f6881be_62d9_4b96_7331_a962ced095f7
  dbd80fa4_4b36_fb8e_fb6e_f2aec789aa6b["cloneAstNode"]
  f6c14bbb_2e42_58cc_18f1_c89a243da9c0 --> dbd80fa4_4b36_fb8e_fb6e_f2aec789aa6b
  2a22052d_f868_4f88_0a03_2033be58172d["styleRule"]
  f6c14bbb_2e42_58cc_18f1_c89a243da9c0 --> 2a22052d_f868_4f88_0a03_2033be58172d
  9b49f3c6_0c8d_5c62_965c_30a1db6499f8["toCss"]
  f6c14bbb_2e42_58cc_18f1_c89a243da9c0 --> 9b49f3c6_0c8d_5c62_965c_30a1db6499f8
  73875259_ec95_9835_94d8_655298d1f0e9["attribute-selector-parser.ts"]
  f6c14bbb_2e42_58cc_18f1_c89a243da9c0 --> 73875259_ec95_9835_94d8_655298d1f0e9
  ba6fca27_7720_5839_0f92_bc2abb8db636["candidate.ts"]
  f6c14bbb_2e42_58cc_18f1_c89a243da9c0 --> ba6fca27_7720_5839_0f92_bc2abb8db636
  23c6e5a0_eac4_e9dd_7fcf_1e5c71d28310["cloneCandidate"]
  f6c14bbb_2e42_58cc_18f1_c89a243da9c0 --> 23c6e5a0_eac4_e9dd_7fcf_1e5c71d28310
  2c0c2c48_7c07_0936_20b9_afcd7eca56e9["cloneVariant"]
  f6c14bbb_2e42_58cc_18f1_c89a243da9c0 --> 2c0c2c48_7c07_0936_20b9_afcd7eca56e9
  49a16f31_6459_6af3_3eaa_e3ee599b3619["printArbitraryValue"]
  f6c14bbb_2e42_58cc_18f1_c89a243da9c0 --> 49a16f31_6459_6af3_3eaa_e3ee599b3619
  f44bccaf_a67b_68ab_8fb1_2226f3e5fe00["printModifier"]
  f6c14bbb_2e42_58cc_18f1_c89a243da9c0 --> f44bccaf_a67b_68ab_8fb1_2226f3e5fe00
  8d84257d_f3b2_cdf8_542f_835967da0481["apply-config-to-theme.ts"]
  f6c14bbb_2e42_58cc_18f1_c89a243da9c0 --> 8d84257d_f3b2_cdf8_542f_835967da0481
  style f6c14bbb_2e42_58cc_18f1_c89a243da9c0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { substituteAtApply } from './apply'
import { atRule, cloneAstNode, styleRule, toCss, type AstNode } from './ast'
import * as AttributeSelectorParser from './attribute-selector-parser'
import {
  cloneCandidate,
  cloneVariant,
  printArbitraryValue,
  printModifier,
  type Candidate,
  type CandidateModifier,
  type NamedUtilityValue,
  type Variant,
} from './candidate'
import { keyPathToCssProperty } from './compat/apply-config-to-theme'
import { constantFoldDeclaration } from './constant-fold-declaration'
import type { DesignSystem as BaseDesignSystem } from './design-system'
import { CompileAstFlags } from './design-system'
import { expandDeclaration } from './expand-declaration'
import * as SelectorParser from './selector-parser'
import { ThemeOptions } from './theme'
import type { Writable } from './types'
import { DefaultMap } from './utils/default-map'
import { dimensions } from './utils/dimensions'
import { isPositiveInteger, isValidSpacingMultiplier } from './utils/infer-data-type'
import { replaceObject } from './utils/replace-object'
import { segment } from './utils/segment'
import { toKeyPath } from './utils/to-key-path'
import * as ValueParser from './value-parser'
import { walk, WalkAction } from './walk'

export interface CanonicalizeOptions {
  /**
   * The root font size in pixels. If provided, `rem` values will be normalized
   * to `px` values.
   *
   * E.g.: `mt-[16px]` with `rem: 16` will become `mt-4` (assuming `--spacing: 0.25rem`).
   */
  rem?: number

  /**
   * Whether to collapse multiple utilities into a single utility if possible.
   *
   * E.g.: `mt-2 mr-2 mb-2 ml-2` → `m-2`
   */
  collapse?: boolean

  /**
   * Whether to convert between logical and physical properties when collapsing
   * utilities.
   *
   * E.g.: `mr-2 ml-2` → `mx-2`
   */
  logicalToPhysical?: boolean
}

enum Features {
  /**
   * No features enabled (default)
   */
  None = 0,
// ... (2558 more lines)

Domain

Subdomains

Frequently Asked Questions

What does canonicalize-candidates.ts do?
canonicalize-candidates.ts is a source file in the tailwindcss codebase, written in typescript. It belongs to the Oxide domain, Extractor subdomain.
What functions are defined in canonicalize-candidates.ts?
canonicalize-candidates.ts defines 47 function(s): Candidate, allVariablesAreUsed, arbitraryUtilities, arbitraryValueToBareValueUtility, arbitraryValueToBareValueVariant, arbitraryVariants, bareValueUtilities, bgGradientToLinear, canonicalizeAst, canonicalizeCandidates, and 37 more.
What does canonicalize-candidates.ts depend on?
canonicalize-candidates.ts imports 44 module(s): CompileAstFlags, DefaultMap, DesignSystem, ThemeOptions, WalkAction, Writable, apply-config-to-theme.ts, apply.ts, and 36 more.
What files import canonicalize-candidates.ts?
canonicalize-candidates.ts is imported by 4 file(s): expand-declaration.test.ts, expand-declaration.ts, migrate-arbitrary-variants.ts, migrate.ts.
Where is canonicalize-candidates.ts in the architecture?
canonicalize-candidates.ts is located at packages/tailwindcss/src/canonicalize-candidates.ts (domain: Oxide, subdomain: Extractor, directory: packages/tailwindcss/src).

Analyze Your Own Codebase

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

Try Supermodel Free