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
  9763f2a9_9f57_9b9d_f9df_a71589bcbb08["onlyAllowedThemeValues()"]
  fad5e0cf_28c4_1123_bbfa_bb74fa036ea3["canMigrateConfig()"]
  fad5e0cf_28c4_1123_bbfa_bb74fa036ea3 -->|calls| 9763f2a9_9f57_9b9d_f9df_a71589bcbb08
  style 9763f2a9_9f57_9b9d_f9df_a71589bcbb08 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.
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