MCPcopy
hub / github.com/tailwindlabs/tailwindcss / buildImportNodes

Function buildImportNodes

packages/tailwindcss/src/at-import.ts:150–178  ·  view source on GitHub ↗
(
  importNode: AstNode,
  importedAst: AstNode[],
  layer: string | null,
  media: string | null,
  supports: string | null,
)

Source from the content-addressed store, hash-verified

148}
149
150function buildImportNodes(
151 importNode: AstNode,
152 importedAst: AstNode[],
153 layer: string | null,
154 media: string | null,
155 supports: string | null,
156): AstNode[] {
157 let root = importedAst
158
159 if (layer !== null) {
160 let node = atRule('@layer', layer, root)
161 node.src = importNode.src
162 root = [node]
163 }
164
165 if (media !== null) {
166 let node = atRule('@media', media, root)
167 node.src = importNode.src
168 root = [node]
169 }
170
171 if (supports !== null) {
172 let node = atRule('@supports', supports[0] === '(' ? supports : `(${supports})`, root)
173 node.src = importNode.src
174 root = [node]
175 }
176
177 return root
178}

Callers 1

substituteAtImportsFunction · 0.85

Calls 1

atRuleFunction · 0.90

Tested by

no test coverage detected