Home / Function/ set() — tailwindcss Function Reference

set() — tailwindcss Function Reference

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

Function typescript OxideCore Scanner calls 2 called by 8

Entity Profile

Dependency Diagram

graph TD
  34278c80_0fb5_dbdf_08de_b896b9703f2c["set()"]
  19c89ebd_512f_276a_754b_c043c41d7bd4["compileCandidates()"]
  19c89ebd_512f_276a_754b_c043c41d7bd4 -->|calls| 34278c80_0fb5_dbdf_08de_b896b9703f2c
  c58d3214_88d6_f4fc_257f_8e84def5b24f["buildDesignSystem()"]
  c58d3214_88d6_f4fc_257f_8e84def5b24f -->|calls| 34278c80_0fb5_dbdf_08de_b896b9703f2c
  95cb326e_6b59_0903_0c96_d221fca5c2b1["parseCss()"]
  95cb326e_6b59_0903_0c96_d221fca5c2b1 -->|calls| 34278c80_0fb5_dbdf_08de_b896b9703f2c
  92fc4472_ec9a_0e20_d3d4_7695919918be["static()"]
  92fc4472_ec9a_0e20_d3d4_7695919918be -->|calls| 34278c80_0fb5_dbdf_08de_b896b9703f2c
  fe630661_7d59_11f5_d1e9_21b8908a2eb4["functional()"]
  fe630661_7d59_11f5_d1e9_21b8908a2eb4 -->|calls| 34278c80_0fb5_dbdf_08de_b896b9703f2c
  7a418a11_25ee_a4c5_13e5_b5effc024d85["compound()"]
  7a418a11_25ee_a4c5_13e5_b5effc024d85 -->|calls| 34278c80_0fb5_dbdf_08de_b896b9703f2c
  7dd403fe_c2f0_f6ed_07d6_e4728ebdd9c0["group()"]
  7dd403fe_c2f0_f6ed_07d6_e4728ebdd9c0 -->|calls| 34278c80_0fb5_dbdf_08de_b896b9703f2c
  e14c7a80_fdf6_db8c_e557_2172bede4092["suggest()"]
  e14c7a80_fdf6_db8c_e557_2172bede4092 -->|calls| 34278c80_0fb5_dbdf_08de_b896b9703f2c
  3c46aba8_0c4e_5897_33b3_68f663ed70ff["nextOrder()"]
  34278c80_0fb5_dbdf_08de_b896b9703f2c -->|calls| 3c46aba8_0c4e_5897_33b3_68f663ed70ff
  591a738c_045a_d84d_5f74_336f1c5339ce["get()"]
  34278c80_0fb5_dbdf_08de_b896b9703f2c -->|calls| 591a738c_045a_d84d_5f74_336f1c5339ce
  style 34278c80_0fb5_dbdf_08de_b896b9703f2c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/variants.ts lines 280–312

  private set<T extends Variant['kind']>(
    name: string,
    {
      kind,
      applyFn,
      compounds,
      compoundsWith,
      order,
    }: {
      kind: T
      applyFn: VariantFn<T>
      compoundsWith: Compounds
      compounds: Compounds
      order?: number
    },
  ) {
    let existing = this.variants.get(name)
    if (existing) {
      Object.assign(existing, { kind, applyFn, compounds })
    } else {
      if (order === undefined) {
        this.lastOrder = this.nextOrder()
        order = this.lastOrder
      }
      this.variants.set(name, {
        kind,
        applyFn,
        order,
        compoundsWith,
        compounds,
      })
    }
  }

Domain

Subdomains

Frequently Asked Questions

What does set() do?
set() is a function in the tailwindcss codebase.
What does set() call?
set() calls 2 function(s): get, nextOrder.
What calls set()?
set() is called by 8 function(s): buildDesignSystem, compileCandidates, compound, functional, group, parseCss, static, suggest.

Analyze Your Own Codebase

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

Try Supermodel Free