Home / Function/ migratePrefixValue() — tailwindcss Function Reference

migratePrefixValue() — tailwindcss Function Reference

Architecture documentation for the migratePrefixValue() function in migrate-prefix.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  b057d93d_6e53_f369_90b0_bb8f3793672e["migratePrefixValue()"]
  d1aa21a8_ad44_6ad5_f1e9_8c1f02bbff2d["prepareConfig()"]
  d1aa21a8_ad44_6ad5_f1e9_8c1f02bbff2d -->|calls| b057d93d_6e53_f369_90b0_bb8f3793672e
  style b057d93d_6e53_f369_90b0_bb8f3793672e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/@tailwindcss-upgrade/src/codemods/template/migrate-prefix.ts lines 131–140

export function migratePrefixValue(prefix: string): string {
  let result = VALID_PREFIX.exec(prefix.toLocaleLowerCase())
  if (!result) {
    console.warn(
      `The prefix "${prefix} can not be used with Tailwind CSS v4 and cannot be converted to a valid one automatically. We've updated it to "tw" for you.`,
    )
    return 'tw'
  }
  return result[0]
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does migratePrefixValue() do?
migratePrefixValue() is a function in the tailwindcss codebase.
What calls migratePrefixValue()?
migratePrefixValue() is called by 1 function(s): prepareConfig.

Analyze Your Own Codebase

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

Try Supermodel Free