I'm not sure I understand classGroups or conflictingClassGroups #404
Unanswered
mariojankovic
asked this question in
Help
Replies: 1 comment
-
Hey @mariojankovic! 👋 The nested values in import { extendTailwindMerge, fromTheme } from 'tailwind-merge'
const customTwMerge = extendTailwindMerge({
override: {
theme: {
borderWidth: ['input'],
borderColor: ['input-active', 'input-error', 'input-color', 'input-disabled'],
},
classGroups: {
- 'border-w': [{ border: fromTheme('borderWidth') }],
- 'border-color': [{ border: fromTheme('borderColor') }],
+ 'border-w': [{ border: [fromTheme('borderWidth')] }],
+ 'border-color': [{ border: [fromTheme('borderColor')] }],
},
},
})
export const twMerge = customTwMerge Here is an example: https://codesandbox.io/p/sandbox/tailwind-merge-404-zvmtgc?file=%2Fsrc%2Findex.ts%3A39%2C4 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey everyone.
I have a fairly large custom tailwind extend I'm using that is generated from a lot of figma tokens.
This is my extended twMerge config:
And when I do
twMerge('border-input border-input-color')
I getborder-input-color
.And when I do
twMerge('border-input border-2')
I getborder-input border-2
which implies that input is actually a border color value, which is wrong.What am I missing?
Beta Was this translation helpful? Give feedback.
All reactions