Home / Function/ extractUsedVariables() — tailwindcss Function Reference

extractUsedVariables() — tailwindcss Function Reference

Architecture documentation for the extractUsedVariables() function in variables.ts from the tailwindcss codebase.

Function typescript OxideCore Extractor calls 2 called by 2

Entity Profile

Dependency Diagram

graph TD
  6dbfaefd_8d1b_d78e_592a_db6ff37aec55["extractUsedVariables()"]
  a6e11c3d_c962_0a65_d91f_6fbe955cf4f0["optimizeAst()"]
  a6e11c3d_c962_0a65_d91f_6fbe955cf4f0 -->|calls| 6dbfaefd_8d1b_d78e_592a_db6ff37aec55
  c58d3214_88d6_f4fc_257f_8e84def5b24f["buildDesignSystem()"]
  c58d3214_88d6_f4fc_257f_8e84def5b24f -->|calls| 6dbfaefd_8d1b_d78e_592a_db6ff37aec55
  a32bba76_f60d_883f_1ff1_276a0bb9db9f["walk()"]
  6dbfaefd_8d1b_d78e_592a_db6ff37aec55 -->|calls| a32bba76_f60d_883f_1ff1_276a0bb9db9f
  e5eb2faf_45a2_ac47_3404_8bd4e7eb6817["parse()"]
  6dbfaefd_8d1b_d78e_592a_db6ff37aec55 -->|calls| e5eb2faf_45a2_ac47_3404_8bd4e7eb6817
  style 6dbfaefd_8d1b_d78e_592a_db6ff37aec55 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/utils/variables.ts lines 4–18

export function extractUsedVariables(raw: string): string[] {
  let variables: string[] = []
  walk(ValueParser.parse(raw), (node) => {
    if (node.kind !== 'function' || node.value !== 'var') return

    walk(node.nodes, (child) => {
      if (child.kind !== 'word' || child.value[0] !== '-' || child.value[1] !== '-') return

      variables.push(child.value)
    })

    return WalkAction.Skip
  })
  return variables
}

Domain

Subdomains

Frequently Asked Questions

What does extractUsedVariables() do?
extractUsedVariables() is a function in the tailwindcss codebase.
What does extractUsedVariables() call?
extractUsedVariables() calls 2 function(s): parse, walk.
What calls extractUsedVariables()?
extractUsedVariables() is called by 2 function(s): buildDesignSystem, optimizeAst.

Analyze Your Own Codebase

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

Try Supermodel Free