Home / Function/ buildImportNodes() — tailwindcss Function Reference

buildImportNodes() — tailwindcss Function Reference

Architecture documentation for the buildImportNodes() function in at-import.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  8b7b19eb_b2e9_7522_24fe_7d4dcb7d22a4["buildImportNodes()"]
  761efede_46a5_5722_0699_0e1b0947c406["substituteAtImports()"]
  761efede_46a5_5722_0699_0e1b0947c406 -->|calls| 8b7b19eb_b2e9_7522_24fe_7d4dcb7d22a4
  a9af385a_fd12_f1d8_7cf0_ccb9b281ca18["atRule()"]
  8b7b19eb_b2e9_7522_24fe_7d4dcb7d22a4 -->|calls| a9af385a_fd12_f1d8_7cf0_ccb9b281ca18
  style 8b7b19eb_b2e9_7522_24fe_7d4dcb7d22a4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/at-import.ts lines 150–178

function buildImportNodes(
  importNode: AstNode,
  importedAst: AstNode[],
  layer: string | null,
  media: string | null,
  supports: string | null,
): AstNode[] {
  let root = importedAst

  if (layer !== null) {
    let node = atRule('@layer', layer, root)
    node.src = importNode.src
    root = [node]
  }

  if (media !== null) {
    let node = atRule('@media', media, root)
    node.src = importNode.src
    root = [node]
  }

  if (supports !== null) {
    let node = atRule('@supports', supports[0] === '(' ? supports : `(${supports})`, root)
    node.src = importNode.src
    root = [node]
  }

  return root
}

Subdomains

Calls

Frequently Asked Questions

What does buildImportNodes() do?
buildImportNodes() is a function in the tailwindcss codebase.
What does buildImportNodes() call?
buildImportNodes() calls 1 function(s): atRule.
What calls buildImportNodes()?
buildImportNodes() is called by 1 function(s): substituteAtImports.

Analyze Your Own Codebase

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

Try Supermodel Free