How to extend TailwindMerge for borderWidth? #393
-
In my borderWidth: {
sm: 'var(--border-width-sm)',
md: 'var(--border-width-md)',
} Now if I use a class like I tried to extend twMerge like this, but it still swallows the style: const twMerge = extendTailwindMerge({
// @ts-expect-error suppress type error ts(2353) TODO: fix
theme: {
borderWidth: ['sm', 'md'],
},
}); What am I doing wrong? P.S. I am getting a typescript error when using the
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Hey @nareshbhatia! 👋 You need to wrap your config in either an const twMerge = extendTailwindMerge({
extend: {
theme: {
borderWidth: ['sm', 'md'],
},
},
}); |
Beta Was this translation helpful? Give feedback.
-
this is still an issue in This is my config: import { extendTailwindMerge } from 'tailwind-merge'
export const customTwMerge = extendTailwindMerge({
extend: {
theme: {
spacing: ['0', 'xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl', '4xl', 'auto'],
borderWidth: ['0', 'sm', 'md', 'lg'],
borderRadius: ['none', 'sm', 'md', 'lg', 'xl', 'round', 'pill'],
},
},
}) Both Border keys return an error:
|
Beta Was this translation helpful? Give feedback.
Hey @nareshbhatia! 👋
You need to wrap your config in either an
extend
(oroverride
) object. This config should work: