walkVariants() — tailwindcss Function Reference
Architecture documentation for the walkVariants() function in canonicalize-candidates.ts from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD 0d3d890d_0584_dd18_a64e_8e1494d409e5["walkVariants()"] f6c14bbb_2e42_58cc_18f1_c89a243da9c0["canonicalize-candidates.ts"] 0d3d890d_0584_dd18_a64e_8e1494d409e5 -->|defined in| f6c14bbb_2e42_58cc_18f1_c89a243da9c0 6647aa24_8d08_48fc_e2fd_dfbcaf425e15["themeToVarVariant()"] 6647aa24_8d08_48fc_e2fd_dfbcaf425e15 -->|calls| 0d3d890d_0584_dd18_a64e_8e1494d409e5 b3ddb484_a420_850d_607a_2221ddf995ca["arbitraryVariants()"] b3ddb484_a420_850d_607a_2221ddf995ca -->|calls| 0d3d890d_0584_dd18_a64e_8e1494d409e5 8bf0bcc8_ce2f_5951_bedb_88d75c61d3f0["arbitraryValueToBareValueVariant()"] 8bf0bcc8_ce2f_5951_bedb_88d75c61d3f0 -->|calls| 0d3d890d_0584_dd18_a64e_8e1494d409e5 4af25bcc_7295_c96c_9ddc_5c19bf644f5e["modernizeArbitraryValuesVariant()"] 4af25bcc_7295_c96c_9ddc_5c19bf644f5e -->|calls| 0d3d890d_0584_dd18_a64e_8e1494d409e5 style 0d3d890d_0584_dd18_a64e_8e1494d409e5 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/tailwindcss/src/canonicalize-candidates.ts lines 903–916
function* walkVariants(variant: Variant) {
function* inner(
variant: Variant,
parent: Extract<Variant, { kind: 'compound' }> | null = null,
): Iterable<[Variant, Extract<Variant, { kind: 'compound' }> | null]> {
yield [variant, parent]
if (variant.kind === 'compound') {
yield* inner(variant.variant, variant)
}
}
yield* inner(variant, null)
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does walkVariants() do?
walkVariants() is a function in the tailwindcss codebase, defined in packages/tailwindcss/src/canonicalize-candidates.ts.
Where is walkVariants() defined?
walkVariants() is defined in packages/tailwindcss/src/canonicalize-candidates.ts at line 903.
What calls walkVariants()?
walkVariants() is called by 4 function(s): arbitraryValueToBareValueVariant, arbitraryVariants, modernizeArbitraryValuesVariant, themeToVarVariant.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free