injectFallbackForInitialFallback() — tailwindcss Function Reference
Architecture documentation for the injectFallbackForInitialFallback() function in css-functions.ts from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD e2634a65_26cb_6344_621a_73314f88e232["injectFallbackForInitialFallback()"] 957946b3_94ca_8f71_30eb_76a6281c51df["theme()"] 957946b3_94ca_8f71_30eb_76a6281c51df -->|calls| e2634a65_26cb_6344_621a_73314f88e232 a32bba76_f60d_883f_1ff1_276a0bb9db9f["walk()"] e2634a65_26cb_6344_621a_73314f88e232 -->|calls| a32bba76_f60d_883f_1ff1_276a0bb9db9f style e2634a65_26cb_6344_621a_73314f88e232 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/tailwindcss/src/css-functions.ts lines 226–243
function injectFallbackForInitialFallback(ast: ValueParser.ValueAstNode[], fallback: string): void {
walk(ast, (node) => {
if (node.kind !== 'function') return
if (node.value !== 'var' && node.value !== 'theme' && node.value !== '--theme') return
if (node.nodes.length === 1) {
node.nodes.push({
kind: 'word',
value: `, ${fallback}`,
})
} else {
let lastNode = node.nodes[node.nodes.length - 1]
if (lastNode.kind === 'word' && lastNode.value === 'initial') {
lastNode.value = fallback
}
}
})
}
Domain
Subdomains
Calls
Called By
Source
Frequently Asked Questions
What does injectFallbackForInitialFallback() do?
injectFallbackForInitialFallback() is a function in the tailwindcss codebase.
What does injectFallbackForInitialFallback() call?
injectFallbackForInitialFallback() calls 1 function(s): walk.
What calls injectFallbackForInitialFallback()?
injectFallbackForInitialFallback() is called by 1 function(s): theme.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free