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
  09703bc3_87d5_bb32_57b1_c6125a46ec90["set()"]
  1176a137_5b06_095c_fa3b_a8db365b8b18["readFromCss()"]
  1176a137_5b06_095c_fa3b_a8db365b8b18 -->|calls| 09703bc3_87d5_bb32_57b1_c6125a46ec90
  style 09703bc3_87d5_bb32_57b1_c6125a46ec90 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
}

Subdomains

Called By

Frequently Asked Questions

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