Skip to content

custom boxShadow being deleted from className when color is specified #275

Answered by dcastil
hexiro asked this question in Help
Discussion options

You must be logged in to vote

Hey @hexiro! 👋

tailwind-merge doesn't have access to the tailwind.config.js file and you need to configure it separately. The default out-of-the-box config of tailwind-merge assumes all unknown classes which could be a color (like shadow-custom) are a color, this is why it de-duplicated it when you use shadow-red-500 afterwards.

Here is an example on how to configure tailwind-merge: https://github.com/dcastil/tailwind-merge/blob/v1.14.0/docs/recipes.md#adding-custom-scale-from-tailwind-config-to-tailwind-merge-config.

And here is the documentation on how the tailwind-merge configuration works: https://github.com/dcastil/tailwind-merge/blob/v1.14.0/docs/configuration.md#usage-with-custom-t…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@hexiro
Comment options

Answer selected by hexiro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
context-v1 Related to tailwind-merge v1
2 participants