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 OxideEngine Scanner calls 2 called by 8

Entity Profile

Dependency Diagram

graph TD
  e37ec412_58f3_7fbe_3589_99329ee9b910["set()"]
  ff716ee9_bd1e_1568_4100_c1d5b3ab8daa["Variants"]
  e37ec412_58f3_7fbe_3589_99329ee9b910 -->|defined in| ff716ee9_bd1e_1568_4100_c1d5b3ab8daa
  f611bd99_74d3_1161_f7f5_4c1d73c377e5["compileCandidates()"]
  f611bd99_74d3_1161_f7f5_4c1d73c377e5 -->|calls| e37ec412_58f3_7fbe_3589_99329ee9b910
  9b965fd7_d8e9_0b43_cd5d_c9294ab598ed["buildDesignSystem()"]
  9b965fd7_d8e9_0b43_cd5d_c9294ab598ed -->|calls| e37ec412_58f3_7fbe_3589_99329ee9b910
  3970218d_3d6c_e455_87cc_45b4a094f0e9["parseCss()"]
  3970218d_3d6c_e455_87cc_45b4a094f0e9 -->|calls| e37ec412_58f3_7fbe_3589_99329ee9b910
  774af68b_6fbe_668c_5fdf_6bbcef9f7ab6["static()"]
  774af68b_6fbe_668c_5fdf_6bbcef9f7ab6 -->|calls| e37ec412_58f3_7fbe_3589_99329ee9b910
  0b45bc8b_6be0_3c76_dfd2_c6a379f6b1ec["functional()"]
  0b45bc8b_6be0_3c76_dfd2_c6a379f6b1ec -->|calls| e37ec412_58f3_7fbe_3589_99329ee9b910
  47e70eea_1a5b_2b9b_d1b3_e2b1c34eec79["compound()"]
  47e70eea_1a5b_2b9b_d1b3_e2b1c34eec79 -->|calls| e37ec412_58f3_7fbe_3589_99329ee9b910
  687e64a5_22c0_2f4f_117f_d39492284510["group()"]
  687e64a5_22c0_2f4f_117f_d39492284510 -->|calls| e37ec412_58f3_7fbe_3589_99329ee9b910
  c67f3732_4d34_491a_b073_a44a28c0af88["suggest()"]
  c67f3732_4d34_491a_b073_a44a28c0af88 -->|calls| e37ec412_58f3_7fbe_3589_99329ee9b910
  eb20f53e_1c6f_df36_499f_0b1c3fbca752["nextOrder()"]
  e37ec412_58f3_7fbe_3589_99329ee9b910 -->|calls| eb20f53e_1c6f_df36_499f_0b1c3fbca752
  9b8bd17a_1b05_f86d_02dc_1f5d07860201["get()"]
  e37ec412_58f3_7fbe_3589_99329ee9b910 -->|calls| 9b8bd17a_1b05_f86d_02dc_1f5d07860201
  style e37ec412_58f3_7fbe_3589_99329ee9b910 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, defined in packages/tailwindcss/src/variants.ts.
Where is set() defined?
set() is defined in packages/tailwindcss/src/variants.ts at line 280.
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