Add config option to ignore variants/modifiers #440
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi! Thanks a lot for the library! Sorry to submit a PR out of the blue, but it was so small that I thought starting a discussion first would be overkill.
I'm trying to use tailwind-merge with a third-party Tailwind plugin I created but I'm running into some issues. Unlike most Tailwind variants, the variants in my plugin change a utility's properties, not its selector (I've seen this in other plugins as well). Currently, these types of variants don't work well with tailwind-merge, because it (reasonably) treats them as normal variants when ideally they would be ignored.
As a potential solution, I added an
ignoredVariants
array (default:[]
) to the config for variants that should be ignored when merging classes. Do you think you'd be interested in adding a feature like this? I'd love to improve my plugin's compatibility with tailwind-merge (my users would appreciate it as well 😅)Thanks!