isValidThemeTuple() — tailwindcss Function Reference
Architecture documentation for the isValidThemeTuple() function in apply-config-to-theme.ts from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD 4b7ca2d9_75a2_87ac_b992_92d7fb86a3c2["isValidThemeTuple()"] 8d84257d_f3b2_cdf8_542f_835967da0481["apply-config-to-theme.ts"] 4b7ca2d9_75a2_87ac_b992_92d7fb86a3c2 -->|defined in| 8d84257d_f3b2_cdf8_542f_835967da0481 961a5671_178b_5937_79ae_2463c9fb3bc9["themeableValues()"] 961a5671_178b_5937_79ae_2463c9fb3bc9 -->|calls| 4b7ca2d9_75a2_87ac_b992_92d7fb86a3c2 style 4b7ca2d9_75a2_87ac_b992_92d7fb86a3c2 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/tailwindcss/src/compat/apply-config-to-theme.ts lines 246–265
function isValidThemeTuple(value: unknown): value is [string, Record<string, string | number>] {
// Check for tuple values of the form
// `[string, Record<string, string | number>]`
if (!Array.isArray(value)) return false
if (value.length !== 2) return false
// A string or number as the "value"
if (typeof value[0] !== 'string' && typeof value[0] !== 'number') return false
// An object as the nested theme values
if (value[1] === undefined || value[1] === null) return false
if (typeof value[1] !== 'object') return false
for (let key of Reflect.ownKeys(value[1])) {
if (typeof key !== 'string') return false
if (typeof value[1][key] !== 'string' && typeof value[1][key] !== 'number') return false
}
return true
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does isValidThemeTuple() do?
isValidThemeTuple() is a function in the tailwindcss codebase, defined in packages/tailwindcss/src/compat/apply-config-to-theme.ts.
Where is isValidThemeTuple() defined?
isValidThemeTuple() is defined in packages/tailwindcss/src/compat/apply-config-to-theme.ts at line 246.
What calls isValidThemeTuple()?
isValidThemeTuple() is called by 1 function(s): themeableValues.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free