migrateSimpleLegacyClasses() — tailwindcss Function Reference
Architecture documentation for the migrateSimpleLegacyClasses() function in migrate-simple-legacy-classes.ts from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD 076e225f_0c49_c0b1_fd74_16773b08019f["migrateSimpleLegacyClasses()"] 91c7b7d7_b75e_448f_492f_b7e96c0ac0c5["isMajor()"] 076e225f_0c49_c0b1_fd74_16773b08019f -->|calls| 91c7b7d7_b75e_448f_492f_b7e96c0ac0c5 style 076e225f_0c49_c0b1_fd74_16773b08019f fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/@tailwindcss-upgrade/src/codemods/template/migrate-simple-legacy-classes.ts lines 31–63
export function migrateSimpleLegacyClasses(
designSystem: DesignSystem,
_userConfig: Config | null,
rawCandidate: string,
): string {
// `outline-none` in v3 has the same meaning as `outline-hidden` in v4. However,
// `outline-none` in v4 _also_ exists but has a different meaning.
//
// We can only migrate `outline-none` to `outline-hidden` if we are migrating a
// v3 project to v4.
if (version.isMajor(3)) {
LEGACY_CLASS_MAP['outline-none'] = 'outline-hidden'
}
// Prepare design system with the unknown legacy classes
if (!seenDesignSystems.has(designSystem)) {
for (let old in LEGACY_CLASS_MAP) {
designSystem.utilities.static(old, () => [])
}
seenDesignSystems.add(designSystem)
}
for (let candidate of designSystem.parseCandidate(rawCandidate)) {
if (candidate.kind === 'static' && Object.hasOwn(LEGACY_CLASS_MAP, candidate.root)) {
return designSystem.printCandidate({
...candidate,
root: LEGACY_CLASS_MAP[candidate.root as keyof typeof LEGACY_CLASS_MAP],
})
}
}
return rawCandidate
}
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does migrateSimpleLegacyClasses() do?
migrateSimpleLegacyClasses() is a function in the tailwindcss codebase.
What does migrateSimpleLegacyClasses() call?
migrateSimpleLegacyClasses() calls 1 function(s): isMajor.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free