Skip to content

Commit

Permalink
Merge pull request #428 from dsernst/patch-1
Browse files Browse the repository at this point in the history
Fix typo in doc/recipes.md
  • Loading branch information
dcastil authored Jun 13, 2024
2 parents f35c825 + 40a2d40 commit d11d604
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/recipes.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Note that by using the `extend` object we're only adding our custom classes to t
I don't recommend using Tailwind's `@apply` directive for classes that might get processed with tailwind-merge.
tailwind-merge would need to be configured so that it knows about which classes `.btn-primary` is in conflict with. This means: If someone adds another Tailwind class to the `@apply` directive, the tailwind-merge config would need to get modified accordignly, keeping it in sync with the written CSS. This easy-to-miss dependency is fragile and can lead to bugs with incorrect merging behavior.
tailwind-merge would need to be configured so that it knows about which classes `.btn-primary` is in conflict with. This means: If someone adds another Tailwind class to the `@apply` directive, the tailwind-merge config would need to get modified accordingly, keeping it in sync with the written CSS. This easy-to-miss dependency is fragile and can lead to bugs with incorrect merging behavior.
Instead of creating custom CSS classes, I recommend keeping the collection of Tailwind classes in a string variable in JavaScript and access it whenever you want to apply those styles. This way you can reuse the collection of styles but don't need to touch the tailwind-merge config.
Expand Down

0 comments on commit d11d604

Please sign in to comment.