Home / Function/ compound() — tailwindcss Function Reference

compound() — tailwindcss Function Reference

Architecture documentation for the compound() function in variants.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  47e70eea_1a5b_2b9b_d1b3_e2b1c34eec79["compound()"]
  ff716ee9_bd1e_1568_4100_c1d5b3ab8daa["Variants"]
  47e70eea_1a5b_2b9b_d1b3_e2b1c34eec79 -->|defined in| ff716ee9_bd1e_1568_4100_c1d5b3ab8daa
  c1a769fc_95ca_ceea_62f9_aedeeedf7c66["createVariants()"]
  c1a769fc_95ca_ceea_62f9_aedeeedf7c66 -->|calls| 47e70eea_1a5b_2b9b_d1b3_e2b1c34eec79
  e37ec412_58f3_7fbe_3589_99329ee9b910["set()"]
  47e70eea_1a5b_2b9b_d1b3_e2b1c34eec79 -->|calls| e37ec412_58f3_7fbe_3589_99329ee9b910
  style 47e70eea_1a5b_2b9b_d1b3_e2b1c34eec79 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/variants.ts lines 126–139

  compound(
    name: string,
    compoundsWith: Compounds,
    applyFn: VariantFn<'compound'>,
    { compounds, order }: { compounds?: Compounds; order?: number } = {},
  ) {
    this.set(name, {
      kind: 'compound',
      applyFn,
      compoundsWith,
      compounds: compounds ?? Compounds.StyleRules,
      order,
    })
  }

Domain

Subdomains

Calls

Called By

Frequently Asked Questions

What does compound() do?
compound() is a function in the tailwindcss codebase, defined in packages/tailwindcss/src/variants.ts.
Where is compound() defined?
compound() is defined in packages/tailwindcss/src/variants.ts at line 126.
What does compound() call?
compound() calls 1 function(s): set.
What calls compound()?
compound() is called by 1 function(s): createVariants.

Analyze Your Own Codebase

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

Try Supermodel Free