arbitraryValueToBareValueUtility() — tailwindcss Function Reference
Architecture documentation for the arbitraryValueToBareValueUtility() function in canonicalize-candidates.ts from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD d7c45bb2_47f5_d563_098b_5023e03204bb["arbitraryValueToBareValueUtility()"] ec55634f_f6e4_3b8b_1267_0b251c4dade1["printCandidate()"] d7c45bb2_47f5_d563_098b_5023e03204bb -->|calls| ec55634f_f6e4_3b8b_1267_0b251c4dade1 07e623bd_0cfb_00fb_6300_b582d8ed9fd0["tryValueReplacements()"] d7c45bb2_47f5_d563_098b_5023e03204bb -->|calls| 07e623bd_0cfb_00fb_6300_b582d8ed9fd0 4cd99e59_ac1e_2a1f_0946_33cc1afd2532["get()"] d7c45bb2_47f5_d563_098b_5023e03204bb -->|calls| 4cd99e59_ac1e_2a1f_0946_33cc1afd2532 style d7c45bb2_47f5_d563_098b_5023e03204bb fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/tailwindcss/src/canonicalize-candidates.ts lines 1367–1391
function arbitraryValueToBareValueUtility(
candidate: Candidate,
options: InternalCanonicalizeOptions,
): Candidate {
// We are only interested in functional utilities with arbitrary values
if (candidate.kind !== 'functional' || candidate.value?.kind !== 'arbitrary') {
return candidate
}
let designSystem = options.designSystem
let signatures = designSystem.storage[UTILITY_SIGNATURE_KEY].get(options.signatureOptions)
let expectedSignature = signatures.get(designSystem.printCandidate(candidate))
if (expectedSignature === null) return candidate
for (let value of tryValueReplacements(candidate)) {
let newSignature = signatures.get(designSystem.printCandidate({ ...candidate, value }))
if (newSignature === expectedSignature) {
candidate.value = value
return candidate
}
}
return candidate
}
Domain
Subdomains
Source
Frequently Asked Questions
What does arbitraryValueToBareValueUtility() do?
arbitraryValueToBareValueUtility() is a function in the tailwindcss codebase.
What does arbitraryValueToBareValueUtility() call?
arbitraryValueToBareValueUtility() calls 3 function(s): get, printCandidate, tryValueReplacements.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free