Next.js Discord

Discord Forum

TailwindCSS not working outside the `app` dir

Answered
Northern snakehead posted this in #help-forum
Open in Discord
Northern snakeheadOP
Hey! I was trying to setup a nextJS project (without src dir), but I'm facing an issue that I've a file outside the app dir - features/auth/components/auth-screen.tsx , but the tailwind I've used in here is not getting reflected. But on adding tailwind inside the app dir, it's working perfectly fine.
I've shadcn-ui installed.
Answered by RushO
Just like how the pages, components and app are included.
View full answer

9 Replies

Can you show your tailwind.config.js file?
Northern snakeheadOP
Here's my tailwind.config.ts file:
I'm not able to send the code here, ig there's some error showing up that I can't share coz I don't have same server or smthn...
@Northern snakehead I'm not able to send the code here, ig there's some error showing up that I can't share coz I don't have same server or smthn...
Holland Lop
Import your global.css file on the top of your file (just the way you've imported it on layout.tsx)
Asian black bear
No, that is misleading. The file that is not being picked up by Tailwind just has to be covered by the content property.
Yup. You have to include the parent folder that includes the file you mentioned, in this case, features/ in to the content property of tailwind.config.ts file.
Just like how the pages, components and app are included.
Answer
@RushO Just like how the `pages`, `components` and `app` are included.
Northern snakeheadOP
Yes, now it's working, thanks 👍