TVke / react-native-tailwindcss

A react-native style system based on TailwindCSS
https://tvke.github.io/react-native-tailwindcss/
MIT License
565 stars 34 forks source link

Is there a way to remove unused styles? #65

Closed johhansantana closed 2 years ago

johhansantana commented 2 years ago

I was wondering since the guide on the regular tailwindcss site explains how to do this but I'm not sure if this is possible with this library?

I'm asking because I use it for a regular react native project but am thinking of using it as well with react-native-web but since part of the performance on the web is the bundle size I was wondering if this would be an issue using this library or if there's a workaround.

TVke commented 2 years ago

Hi

As the package uses the Stylesheet class of react, react is responsible for handling styles. The class handles the style very well and only ones when the app starts. Filtering will not improve performance. If for some reason you think a slimmer version would be better. You can duplicate the class in this repository and remove the unneeded styles.

Greetings Thomas