I'm creating a styling library in my monorepo, and I want this library to import classes from the tailwindcss library, as well as define a couple more custom classes (with @apply keyword), like so
/*libs/shared/ui-styles/src/lib/styles.css*/
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer components {
.btn {
@apply focus:outline-none py-2 px-4 rounded transition ease-in-out duration-150 inline-flex items-center;
}
}
With the following update to the build target options in my workspace.json file
"styles": ["apps/example/src/styles.css", "libs/shared/ui-styles/src/lib/styles.css"],
This does not load the tailwindcss classes when I run my application.
If I add the tailwind imports to the css file of my application, it does work, but I want to extract this to my styling library.
Can someone tell me how to make the @tailwind keyword work in my library?
Thank you
Ps. any other "normal" css (for example css variables) in that library file works just fine.