Home / Function/ get() — tailwindcss Function Reference

get() — tailwindcss Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  a0c16668_c872_21fc_296d_76c8221fee87["get()"]
  1ea8fd4a_634f_c2f0_5465_01d387d5207b["createThemeFn()"]
  1ea8fd4a_634f_c2f0_5465_01d387d5207b -->|calls| a0c16668_c872_21fc_296d_76c8221fee87
  1176a137_5b06_095c_fa3b_a8db365b8b18["readFromCss()"]
  1176a137_5b06_095c_fa3b_a8db365b8b18 -->|calls| a0c16668_c872_21fc_296d_76c8221fee87
  c9955487_1860_09fc_569b_44f655a0567c["get()"]
  a0c16668_c872_21fc_296d_76c8221fee87 -->|calls| c9955487_1860_09fc_569b_44f655a0567c
  style a0c16668_c872_21fc_296d_76c8221fee87 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/compat/plugin-functions.ts lines 222–245

function get(obj: any, path: string[]) {
  for (let i = 0; i < path.length; ++i) {
    let key = path[i]

    // The key does not exist so concatenate it with the next key
    if (obj?.[key] === undefined) {
      if (path[i + 1] === undefined) {
        return undefined
      }

      path[i + 1] = `${key}-${path[i + 1]}`
      continue
    }

    // We never want to index into strings
    if (typeof obj === 'string') {
      return undefined
    }

    obj = obj[key]
  }

  return obj
}

Subdomains

Calls

Frequently Asked Questions

What does get() do?
get() is a function in the tailwindcss codebase.
What does get() call?
get() calls 1 function(s): get.
What calls get()?
get() is called by 2 function(s): createThemeFn, readFromCss.

Analyze Your Own Codebase

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

Try Supermodel Free