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
  3dfa5e99_766a_d217_730f_6919ba425147["migratePrefixValue()"]
  ac975fa0_6dfb_5b95_d79d_ea10cebf80a5["prepareConfig()"]
  ac975fa0_6dfb_5b95_d79d_ea10cebf80a5 -->|calls| 3dfa5e99_766a_d217_730f_6919ba425147
  style 3dfa5e99_766a_d217_730f_6919ba425147 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]
}

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