fix(shadcn): fallback style resolving issue

This commit is contained in:
shadcn
2026-03-08 12:05:55 +04:00
parent 119d534e85
commit 5edf9c95b7
2 changed files with 16 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
"shadcn": patch
---
fix fallback style resolving issue

View File

@@ -213,7 +213,17 @@ export function findCommonRoot(cwd: string, resolvedPath: string) {
// TODO: Cache this call.
export async function getTargetStyleFromConfig(cwd: string, fallback: string) {
const projectInfo = await getProjectInfo(cwd)
return projectInfo?.tailwindVersion === "v4" ? "new-york-v4" : fallback
// Only override legacy v3 style names for Tailwind v4 projects.
// Preserve v4 style names like "base-nova", "radix-nova", etc.
if (
projectInfo?.tailwindVersion === "v4" &&
(!fallback || fallback === "new-york" || fallback === "default")
) {
return "new-york-v4"
}
return fallback
}
export function getBase(style: string | undefined) {