wuarmin
wuarmin

Reputation: 4015

How to avoid css bloat when using a tailwindcss component library?

I built a component library that uses tailwindcss. Now I'm wondering how best to specify the source to avoid css bloat. The ui-library offers lots of components, but my app just use a few of them. I.e.

import { Button } from "shared-ui/button"; // Button contains tailwindcss classes 

If I add the source like this:

@source "node_modules/shared-ui/dist/**/*.js'"

all components are parsed and unnecessary css-directives land in my result-app-css file. How to fix this?

Thanks!

Upvotes: 0

Views: 36

Answers (0)

Related Questions