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 fa96a286_4ca6_d0e0_aef1_360d90b3660a["isValidThemeTuple()"] 3e33c90a_e618_0b36_8589_88cf333c1482["themeableValues()"] 3e33c90a_e618_0b36_8589_88cf333c1482 -->|calls| fa96a286_4ca6_d0e0_aef1_360d90b3660a style fa96a286_4ca6_d0e0_aef1_360d90b3660a 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.
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