Tailwind CSS v4 not applying styles from component library in monorepo (React + TS + Vite) #18770
-
Hello everyone, I’m currently migrating a monorepo to Tailwind CSS v4 and I’m struggling with getting styles from a shared React component library (built with TypeScript + Vite + Tailwind) to work in the consuming app. Context
What I did (based on [this resolved issue](#18758)):
The issue
What I tried
Question👉 What am I missing to make Tailwind v4 pick up and compile the classes from my component library correctly?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Consider providing a git repo that reproduces the issue (can be a trimmed down version) and we can take a look for you. |
Beta Was this translation helpful? Give feedback.
The serif font immediately clues me in that you haven't actually imported the CSS into the app code for the consumer. So, you should add:
To
src/main.tsx
orsrc/App.tsx
. This will mean the CSS file would actually be loaded and processed with Tailwind. However, when doing this, we get:This shows the CSS is now pro…