ui
ui copied to clipboard
fix(cli): change the default path for tailwind globals css
Fixes shadcn-ui/ui#1821 Fixes shadcn-ui/ui#2302
TODO:
- [x] change default path for tailwind globals css file
- [ ] update in all the docs (cli docs, astro docs, gatsby docs, laravel docs, next docs, remix docs, vite docs)
@lem0n4id is attempting to deploy a commit to the shadcn-pro Team on Vercel.
A member of the Team first needs to authorize it.
Should i update the docs as well?
For example, in line 32 of nextjs docs :
- Where is your global CSS file? › › app/globals.css
+ Where is your global CSS file? › › src/app/globals.css
@lem0n4id The thing is not all apps uses the src dir. I think a better fix would be to detect the src
dir and add it to the suggested path. What do you think?
@shadcn That makes perfect sense.
So would this work as the fix?
- export const DEFAULT_TAILWIND_CSS = "app/globals.css"
+ export const DEFAULT_TAILWIND_CSS = existsSync(path.resolve("./src")) ? "src/app/globals.css" : "app/globals.css"
@lem0n4id We'll need to do this per framework-basis. Check out the example for Next.js here: https://github.com/shadcn-ui/ui/blob/main/packages/cli/src/utils/get-project-info.ts
(I'm going to close this for now since we need a different implementation but feel free to reopen if you have any questions. Thank you.)