Home / Function/ resolveThemeValue() — tailwindcss Function Reference

resolveThemeValue() — tailwindcss Function Reference

Architecture documentation for the resolveThemeValue() function in apply-config-to-theme.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  e512528a_2506_964d_514b_bab67f99b575["resolveThemeValue()"]
  6a318dee_41f9_3a09_3876_c73653eb7c29["createSpacingCache()"]
  6a318dee_41f9_3a09_3876_c73653eb7c29 -->|calls| e512528a_2506_964d_514b_bab67f99b575
  1d9d6293_9d1d_5445_6e1b_8f6256992b8a["resolveVariablesInValue()"]
  1d9d6293_9d1d_5445_6e1b_8f6256992b8a -->|calls| e512528a_2506_964d_514b_bab67f99b575
  9e2f12c0_83ef_256b_739b_9ec6ebc69b08["applyCompatibilityHooks()"]
  9e2f12c0_83ef_256b_739b_9ec6ebc69b08 -->|calls| e512528a_2506_964d_514b_bab67f99b575
  0f8ac574_990e_8595_a6ed_11422b8a8ec4["upgradeToFullPluginSupport()"]
  0f8ac574_990e_8595_a6ed_11422b8a8ec4 -->|calls| e512528a_2506_964d_514b_bab67f99b575
  ffa1d3be_8116_7cd8_db2c_a42892f9c21a["applyConfigToTheme()"]
  ffa1d3be_8116_7cd8_db2c_a42892f9c21a -->|calls| e512528a_2506_964d_514b_bab67f99b575
  style e512528a_2506_964d_514b_bab67f99b575 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/compat/apply-config-to-theme.ts lines 5–20

function resolveThemeValue(value: unknown, subValue: string | null = null): string | null {
  if (
    Array.isArray(value) &&
    value.length === 2 &&
    typeof value[1] === 'object' &&
    typeof value[1] !== null
  ) {
    return subValue ? (value[1][subValue] ?? null) : value[0]
  } else if (Array.isArray(value) && subValue === null) {
    return value.join(', ')
  } else if (typeof value === 'string' && subValue === null) {
    return value
  }

  return null
}

Subdomains

Frequently Asked Questions

What does resolveThemeValue() do?
resolveThemeValue() is a function in the tailwindcss codebase.
What calls resolveThemeValue()?
resolveThemeValue() is called by 5 function(s): applyCompatibilityHooks, applyConfigToTheme, createSpacingCache, resolveVariablesInValue, upgradeToFullPluginSupport.

Analyze Your Own Codebase

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

Try Supermodel Free