Home / Function/ canonicalizeCandidates() — tailwindcss Function Reference

canonicalizeCandidates() — tailwindcss Function Reference

Architecture documentation for the canonicalizeCandidates() function in canonicalize-candidates.ts from the tailwindcss codebase.

Function typescript OxideCore Scanner calls 6 called by 1

Entity Profile

Dependency Diagram

graph TD
  74a4389f_06f5_9213_9ee9_31f7f355cad8["canonicalizeCandidates()"]
  c80497ee_3abb_7410_a35b_842038c6a0af["migrateCached()"]
  c80497ee_3abb_7410_a35b_842038c6a0af -->|calls| 74a4389f_06f5_9213_9ee9_31f7f355cad8
  a36abaf5_b2bc_57c5_1398_dffcc9edbd56["createSignatureOptions()"]
  74a4389f_06f5_9213_9ee9_31f7f355cad8 -->|calls| a36abaf5_b2bc_57c5_1398_dffcc9edbd56
  95e9d9ae_b953_4374_57cb_b205d5a29a27["createCanonicalizeOptions()"]
  74a4389f_06f5_9213_9ee9_31f7f355cad8 -->|calls| 95e9d9ae_b953_4374_57cb_b205d5a29a27
  207ada18_60f2_10b9_7c9e_99bdb32f4ed7["prepareDesignSystemStorage()"]
  74a4389f_06f5_9213_9ee9_31f7f355cad8 -->|calls| 207ada18_60f2_10b9_7c9e_99bdb32f4ed7
  24d95be4_356f_a1f9_9702_2a4f413db0f5["add()"]
  74a4389f_06f5_9213_9ee9_31f7f355cad8 -->|calls| 24d95be4_356f_a1f9_9702_2a4f413db0f5
  830bd29f_3420_9239_4bdf_20fd57106bdf["collapseCandidates()"]
  74a4389f_06f5_9213_9ee9_31f7f355cad8 -->|calls| 830bd29f_3420_9239_4bdf_20fd57106bdf
  0aa64a1c_efd8_a69d_48ed_649b7a86c854["get()"]
  74a4389f_06f5_9213_9ee9_31f7f355cad8 -->|calls| 0aa64a1c_efd8_a69d_48ed_649b7a86c854
  style 74a4389f_06f5_9213_9ee9_31f7f355cad8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/canonicalize-candidates.ts lines 179–198

export function canonicalizeCandidates(
  baseDesignSystem: BaseDesignSystem,
  candidates: string[],
  options?: CanonicalizeOptions,
): string[] {
  let signatureOptions = createSignatureOptions(baseDesignSystem, options)
  let canonicalizeOptions = createCanonicalizeOptions(baseDesignSystem, signatureOptions, options)

  let designSystem = prepareDesignSystemStorage(baseDesignSystem)

  let result = new Set<string>()
  let cache = designSystem.storage[CANONICALIZE_CANDIDATE_KEY].get(canonicalizeOptions)
  for (let candidate of candidates) {
    result.add(cache.get(candidate))
  }

  return result.size <= 1 || !(canonicalizeOptions.features & Features.CollapseUtilities)
    ? Array.from(result)
    : collapseCandidates(canonicalizeOptions, Array.from(result))
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does canonicalizeCandidates() do?
canonicalizeCandidates() is a function in the tailwindcss codebase.
What does canonicalizeCandidates() call?
canonicalizeCandidates() calls 6 function(s): add, collapseCandidates, createCanonicalizeOptions, createSignatureOptions, get, prepareDesignSystemStorage.
What calls canonicalizeCandidates()?
canonicalizeCandidates() is called by 1 function(s): migrateCached.

Analyze Your Own Codebase

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

Try Supermodel Free