Home / Function/ migrateMaxWidthScreen() — tailwindcss Function Reference

migrateMaxWidthScreen() — tailwindcss Function Reference

Architecture documentation for the migrateMaxWidthScreen() function in migrate-max-width-screen.ts from the tailwindcss codebase.

Entity Profile

Relationship Graph

Source Code

packages/@tailwindcss-upgrade/src/codemods/template/migrate-max-width-screen.ts lines 4–25

export function migrateMaxWidthScreen(
  designSystem: DesignSystem,
  _userConfig: Config | null,
  rawCandidate: string,
): string {
  for (let candidate of designSystem.parseCandidate(rawCandidate)) {
    if (
      candidate.kind === 'functional' &&
      candidate.root === 'max-w' &&
      candidate.value?.value.startsWith('screen-')
    ) {
      return designSystem.printCandidate({
        ...candidate,
        value: {
          ...candidate.value,
          value: `[theme(screens.${candidate.value.value.slice(7)})]`,
        },
      })
    }
  }
  return rawCandidate
}

Subdomains

Analyze Your Own Codebase

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

Try Supermodel Free