Home / Function/ onlyAllowedThemeValues() — tailwindcss Function Reference

onlyAllowedThemeValues() — tailwindcss Function Reference

Architecture documentation for the onlyAllowedThemeValues() function in migrate-js-config.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  e1a348f7_349e_c682_8a19_351237c4f546["onlyAllowedThemeValues()"]
  b2ba3368_7330_fe20_4543_9cafa8cfedc0["migrate-js-config.ts"]
  e1a348f7_349e_c682_8a19_351237c4f546 -->|defined in| b2ba3368_7330_fe20_4543_9cafa8cfedc0
  7a3f2d88_6f0c_1a25_f3a3_982e5c35e67a["canMigrateConfig()"]
  7a3f2d88_6f0c_1a25_f3a3_982e5c35e67a -->|calls| e1a348f7_349e_c682_8a19_351237c4f546
  style e1a348f7_349e_c682_8a19_351237c4f546 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/@tailwindcss-upgrade/src/codemods/config/migrate-js-config.ts lines 474–489

function onlyAllowedThemeValues(theme: ThemeConfig): boolean {
  for (let key of Object.keys(theme)) {
    if (!ALLOWED_THEME_KEYS.includes(key)) {
      return false
    }
  }

  if ('screens' in theme && typeof theme.screens === 'object' && theme.screens !== null) {
    for (let screen of Object.values(theme.screens)) {
      if (typeof screen === 'object' && screen !== null && ('max' in screen || 'raw' in screen)) {
        return false
      }
    }
  }
  return true
}

Subdomains

Called By

Frequently Asked Questions

What does onlyAllowedThemeValues() do?
onlyAllowedThemeValues() is a function in the tailwindcss codebase, defined in packages/@tailwindcss-upgrade/src/codemods/config/migrate-js-config.ts.
Where is onlyAllowedThemeValues() defined?
onlyAllowedThemeValues() is defined in packages/@tailwindcss-upgrade/src/codemods/config/migrate-js-config.ts at line 474.
What calls onlyAllowedThemeValues()?
onlyAllowedThemeValues() is called by 1 function(s): canMigrateConfig.

Analyze Your Own Codebase

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

Try Supermodel Free