Replies: 1 comment 1 reply
-
|
great catch, you are indeed right. with tailwind v4 they announced automatic content detection
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all!
I am trying to understand a Shadcn monorepo setup and how the Tailwind detects which files to scan in both repos.
I created a new fresh monorepo according to this instruction: https://ui.shadcn.com/docs/monorepo.
I have this setup:

Everything works great. Build works.
But I dont understand why this file
packages/ui/src/styles/globals.csshas these@sourcedirectives with only 3 relative parent lookups? It should use 4 relative parent lookups to reach the repo root dir.When I run web repo build script it imports "@workspace/ui/globals.css" which points to the
packages/ui/src/styles/globals.cssfile and Tailwind will start process it. Tailwind will process those@sourcedirectives and they will be resolved to:@source "../../../apps/**/*.{ts,tsx}"->packages/apps/**/*.{ts,tsx}which does not exist.@source "../../../components/**/*.{ts,tsx}"->packages/components/**/*.{ts,tsx}which does not exist.@source "../**/*.{ts,tsx}"->src/**/*.{ts,tsx}which exists and make sense (scan all files in @workspace/ui package).I also added my custom tw class
<h1 className="h-[15546335px]">Hello World</h1>in theapps/web/app/page.tsxand it built it correctly even if I remove these directives from thepackages/ui/src/styles/globals.css:It seems that Tailwind just use default behaviour and scans the @workspace/web package src by default with or without those invalid
@sourcedirectives.Correct me if I am wrong.
Beta Was this translation helpful? Give feedback.
All reactions