Custom classes getting removed #315
-
I created a new font size style but that is getting removed tailwind config this is my component in nextjs application
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hey @themashcodee! 👋 tailwind-merge doesn't have access to the tailwind.config.js file and you need to configure it separately so it knows about the 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-tailwind-config. |
Beta Was this translation helpful? Give feedback.
-
Upon searching the issues and reading the docs I was still confused how to configure tailwind merge properly, this is what worked for me. My incomplete module.exports = {
theme: {
extend: {
fontSize: {
micro: [
"0.625rem",
{
lineHeight: "110%",
letterSpacing: "-0.0125rem",
},
]
}
}
} My twmerge call had Here is the extendTailwindMerge that I put together: const customTwMerge = extendTailwindMerge({
classGroups: {
fontSize: ["text-micro"],
},
}) It wasn't clear to me if I should have used |
Beta Was this translation helpful? Give feedback.
Hey @themashcodee! 👋
tailwind-merge doesn't have access to the tailwind.config.js file and you need to configure it separately so it knows about the
text-xxs
class.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-tailwind-config.
Related: #302, #276, #275, #274, #250, #207