Tailwind CSS is generating unused classes. #16575
omaralfawareh
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Context:
I'm using an Nx monorepo with multiple Next.js applications and a shared library that contains common components. Each app uses Tailwind CSS configured with one root Tailwind configuration file.
Problem:
When I import any component from the shared library in any of my applications, I need to reference the shared library components in the app’s Tailwind config (tailwind.config.js) under the content field. However, this causes Tailwind to generate all CSS classes for the entire shared library, even though the app may only use a few components from the library.
I want a way to:
Challenges:
Request:
I’m looking for solutions or best practices to handle Tailwind class generation when using shared component libraries ideally with some automation to reduce manual configuration effort, so that i only generate the classes that I actually used in my build.
Beta Was this translation helpful? Give feedback.
All reactions