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
  8711d3c6_2537_4267_acab_f8fa7a5ab188["compound()"]
  7c96535c_85cb_d6bf_efe4_875fba595c4f["createVariants()"]
  7c96535c_85cb_d6bf_efe4_875fba595c4f -->|calls| 8711d3c6_2537_4267_acab_f8fa7a5ab188
  13f9b85f_58c4_5390_3b22_04d00b93361b["set()"]
  8711d3c6_2537_4267_acab_f8fa7a5ab188 -->|calls| 13f9b85f_58c4_5390_3b22_04d00b93361b
  style 8711d3c6_2537_4267_acab_f8fa7a5ab188 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,
    })
  }

Subdomains

Calls

Called By

Frequently Asked Questions

What does compound() do?
compound() is a function in the tailwindcss codebase.
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