Home / Function/ resolveWith() — tailwindcss Function Reference

resolveWith() — tailwindcss Function Reference

Architecture documentation for the resolveWith() function in theme.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  ce5a227d_e817_af18_3503_3cfcf78ea325["resolveWith()"]
  734cf7ec_fb2a_2532_7b20_b3a815c7e3e6["Theme"]
  ce5a227d_e817_af18_3503_3cfcf78ea325 -->|defined in| 734cf7ec_fb2a_2532_7b20_b3a815c7e3e6
  3df007ff_869c_dbfa_d21c_be64d5ce3eec["resolveValueFunction()"]
  3df007ff_869c_dbfa_d21c_be64d5ce3eec -->|calls| ce5a227d_e817_af18_3503_3cfcf78ea325
  378e03e8_d700_b258_53b3_5bd078db1e2b["get()"]
  ce5a227d_e817_af18_3503_3cfcf78ea325 -->|calls| 378e03e8_d700_b258_53b3_5bd078db1e2b
  style ce5a227d_e817_af18_3503_3cfcf78ea325 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/theme.ts lines 245–274

  resolveWith(
    candidateValue: string,
    themeKeys: ThemeKey[],
    nestedKeys: `--${string}`[] = [],
  ): [string, Record<string, string>] | null {
    let themeKey = this.#resolveKey(candidateValue, themeKeys)

    if (!themeKey) return null

    let extra = {} as Record<string, string>
    for (let name of nestedKeys) {
      let nestedKey = `${themeKey}${name}`
      let nestedValue = this.values.get(nestedKey)!
      if (!nestedValue) continue

      if (nestedValue.options & ThemeOptions.INLINE) {
        extra[name] = nestedValue.value
      } else {
        extra[name] = this.#var(nestedKey)!
      }
    }

    let value = this.values.get(themeKey)!

    if (value.options & ThemeOptions.INLINE) {
      return [value.value, extra]
    }

    return [this.#var(themeKey)!, extra]
  }

Domain

Subdomains

Calls

Frequently Asked Questions

What does resolveWith() do?
resolveWith() is a function in the tailwindcss codebase, defined in packages/tailwindcss/src/theme.ts.
Where is resolveWith() defined?
resolveWith() is defined in packages/tailwindcss/src/theme.ts at line 245.
What does resolveWith() call?
resolveWith() calls 1 function(s): get.
What calls resolveWith()?
resolveWith() is called by 1 function(s): resolveValueFunction.

Analyze Your Own Codebase

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

Try Supermodel Free