3 ms·
> Should I have a shared tailwind.config.js? Yes. > If I have to add node_modules/my-library to the purge directories I believe the point of Tailwind is that
by wishinghand 6y ago
> Should I have a shared tailwind.config.js?
Yes.
> If I have to add node_modules/my-library to the purge directories
I believe the point of Tailwind is that you don't have these outer libraries anymore. If you need a piece of UI implemented, you copy/paste the markup with the required classes added. There is no `modal` class that completely modifies specific nested HTML. And if it's a complete palette/padding change, then that happens in the config.
> ...how do I prevent the same m-1 to have two different values, one from the shared component library and another from my own application?
`m-1` should never have different values in different contexts of the same project, unless the set of classes suffixed by `-1` is adjusted as a whole (ie- letting users resize the UI outside of the built-in browser magnification).
> how you would use the "purgecss" feature in a large project
Purge should happen in deployment, not in development. That way if a class is added that has never been used before, it makes it into the site without issue.
- midrus 6y ago> I believe the point of Tailwind is that you don't have these outer libraries anymore This is a total blocker for this use case then. As a member of one of multiple teams, I won't be able to convince anyone if we cannot have a shared, consistent "Datepicker", "AutocompleteInput", "TagInput", etc... Copy pasting these components is not an option for us.
- wishinghand 6y ago> Copy pasting these components is not an option for us. Uhhh...why not? Have a repo with your versions of components if they're the exact same from project to project, and import them.