Skip to content

Tailwind merge-warn-conflicts #311

Answered by dcastil
mcgois asked this question in Ideas
Discussion options

You must be logged in to vote

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 and twJoin 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.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mcgois
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
context-v1 Related to tailwind-merge v1
2 participants