-
tailwind-merge could have another function besides merge and join to just show conflicts. In this way, the developer could use this function and get warnings at the console and fix them... This workflow would prevent to ship to production all twMerge dependencies. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @mcgois! 👋 I would prefer not to include a function like this in the library to prevent the library from growing in scope too much. The focus of tailwind-merge is to intentionally merge conflicting styles in reusable components where you expect conflicts to happen and where they should not be treated as errors. But you can write this function yourself with the help of PS: Thanks for your patience, I'm just coming back from a vacation. |
Beta Was this translation helpful? Give feedback.
Hey @mcgois! 👋
I would prefer not to include a function like this in the library to prevent the library from growing in scope too much. The focus of tailwind-merge is to intentionally merge conflicting styles in reusable components where you expect conflicts to happen and where they should not be treated as errors.
But you can write this function yourself with the help of
twMerge
andtwJoin
and e.g. only apply in in dev-mode. You can check out https://codesandbox.io/s/tailwind-merge-playground-cssr35?file=/src/index.ts on how to do it, I use both function to figure out which classes were removed from the final string.PS: Thanks for your patience, I'm just coming back from a vacation.