mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-07-02 17:08:39 +00:00
fix(shadcn): fallback style resolving issue
This commit is contained in:
5
.changeset/dark-lemons-invite.md
Normal file
5
.changeset/dark-lemons-invite.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"shadcn": patch
|
||||
---
|
||||
|
||||
fix fallback style resolving issue
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user