Home / Function/ set() — tailwindcss Function Reference

set() — tailwindcss Function Reference

Architecture documentation for the set() function in plugin-functions.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  c2e516d5_98ab_5008_963a_c5eda5f9d8a9["set()"]
  3d2f062b_d3ec_6b3a_dc32_9d2e4732e20e["plugin-functions.ts"]
  c2e516d5_98ab_5008_963a_c5eda5f9d8a9 -->|defined in| 3d2f062b_d3ec_6b3a_dc32_9d2e4732e20e
  bdec5541_c088_b3c7_4457_73a4592c6631["readFromCss()"]
  bdec5541_c088_b3c7_4457_73a4592c6631 -->|calls| c2e516d5_98ab_5008_963a_c5eda5f9d8a9
  style c2e516d5_98ab_5008_963a_c5eda5f9d8a9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/compat/plugin-functions.ts lines 247–257

function set(obj: any, path: string[], value: any) {
  for (let key of path.slice(0, -1)) {
    if (obj[key] === undefined) {
      obj[key] = {}
    }

    obj = obj[key]
  }

  obj[path[path.length - 1]] = value
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does set() do?
set() is a function in the tailwindcss codebase, defined in packages/tailwindcss/src/compat/plugin-functions.ts.
Where is set() defined?
set() is defined in packages/tailwindcss/src/compat/plugin-functions.ts at line 247.
What calls set()?
set() is called by 1 function(s): readFromCss.

Analyze Your Own Codebase

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

Try Supermodel Free