Home / Function/ expand() — tailwindcss Function Reference

expand() — tailwindcss Function Reference

Architecture documentation for the expand() function in expand-declaration.test.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  8ea56f72_5e23_1ddc_863d_757d2deb5a0f["expand()"]
  257c4715_dc91_0c7f_fce8_433a757d9ce6["parse()"]
  8ea56f72_5e23_1ddc_863d_757d2deb5a0f -->|calls| 257c4715_dc91_0c7f_fce8_433a757d9ce6
  e9d556bc_f22d_356c_1bd2_27442c34b5c7["walk()"]
  8ea56f72_5e23_1ddc_863d_757d2deb5a0f -->|calls| e9d556bc_f22d_356c_1bd2_27442c34b5c7
  524663ee_dcd5_80b9_29bd_e2f21fc950aa["expandDeclaration()"]
  8ea56f72_5e23_1ddc_863d_757d2deb5a0f -->|calls| 524663ee_dcd5_80b9_29bd_e2f21fc950aa
  af90c185_29a2_6c4c_ef06_b18f00f7655c["toCss()"]
  8ea56f72_5e23_1ddc_863d_757d2deb5a0f -->|calls| af90c185_29a2_6c4c_ef06_b18f00f7655c
  style 8ea56f72_5e23_1ddc_863d_757d2deb5a0f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/expand-declaration.test.ts lines 10–21

function expand(input: string, options: SignatureFeatures): string {
  let ast = parse(input)

  walk(ast, (node) => {
    if (node.kind === 'declaration') {
      let result = expandDeclaration(node, options)
      if (result) return WalkAction.ReplaceSkip(result)
    }
  })

  return toCss(ast)
}

Subdomains

Frequently Asked Questions

What does expand() do?
expand() is a function in the tailwindcss codebase.
What does expand() call?
expand() calls 4 function(s): expandDeclaration, parse, toCss, walk.

Analyze Your Own Codebase

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

Try Supermodel Free