How to extend twMerge properly for font-weight and font-family #226
-
I made some overrides on tailwind
and I have been trying to write a custom twMerge to support these configs but with no solution. I need this But it always return Also, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hey @mohamedGamalAbuGalala! 👋 There is a guide for this here: https://github.com/dcastil/tailwind-merge/blob/v1.12.0/docs/recipes.md#adding-custom-scale-from-tailwind-config-to-tailwind-merge-config For your specific Tailwind config this would be tailwind-merge config: const twMerge = extendTailwindMerge({
classGroups: {
'font-weight': ['font-max'],
// screens don't need to be configured in tailwind-merge
// custom font families are supported out of the box and don't need to be configured
// custom colors are supported out of the box and don't need to be configured
// custom line heights with numerical values work out of the box
'max-w': ['max-w-default']
}
}) |
Beta Was this translation helpful? Give feedback.
Hey @mohamedGamalAbuGalala! 👋
There is a guide for this here: https://github.com/dcastil/tailwind-merge/blob/v1.12.0/docs/recipes.md#adding-custom-scale-from-tailwind-config-to-tailwind-merge-config
For your specific Tailwind config this would be tailwind-merge config: