-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tailwindcss-mangle not working with tailwind-merge #44
Comments
Yes, this is the case, because Let me think about how to solve this situation. |
hey ser! did you find a solution? |
* chore: move ctx to core * chore: add preserve fn * chore: add preProcessRawCode method * chore(demo): twMerge * chore: commit vue case * chore: fix merge options * chore: commit preserveFunction fn demo * feat: add preserveFunction option for tailwindcss-mangle not working with tailwind-merge #44
Hello, in version // tailwindcss-mangle.config.ts
import { defineConfig } from 'tailwindcss-patch'
export default defineConfig({
mangle: {
preserveFunction: ['twMerge', 'cn']
}
}) Then: // all be preserved
const aaa = twMerge('px-2 py-1 bg-red-100 hover:bg-red-800', 'p-3 bg-[#B91C1C]')
// all be preserved
const bbb = cn(
{
'p-3': true
},
'p-1',
['p-2', true && 'p-4']
)
// but in this case, only `'text-[#654321]'` will be preserved
const a = 'm-1'
const b = 'bg-[#123456]'
const ccc = cn(a,b,'text-[#654321]') Hope this will be helpful to you :) |
didn't work |
i have an utility that overrides duplicate tailwind classes like
"px-5 px-6"
converts to"px-6"
.but when i obfuscate classes, merge doesn't work and implements to dom
tw-abc tw-abd
meanspx-5 px-6
.here is my merging utility source code:
The text was updated successfully, but these errors were encountered: