using tailwind in shared UI components + dynamic stylesheet #10546
-
i've been using Tailwind for years and it is now my favorite UI library. recently i created a shared UI component library which uses tailwind the problem is that the project that uses the shared library has its own JIT compiled tailwind stylesheet which does not include styles in shared library the question is if there is a way for local project to also generate styles used in shared library? or if there is a different approach that could also work? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You should be able include the files of the UI component library, i.e: module.exports = {
content: [
'src/**/*.{js,html}',
'node_modules/path/to/library/**/*.js',
],
// …
}; |
Beta Was this translation helpful? Give feedback.
-
BTW - the tailwind 4.0 version of this is https://tailwindcss.com/docs/detecting-classes-in-source-files#explicitly-registering-sources |
Beta Was this translation helpful? Give feedback.
You should be able include the files of the UI component library, i.e: