-
I'm having some issues with the output of my tailwind classes when using I'm probably completely missing where the documentation mentions this, but I cannot find it for the life of me and I need to speak to a human 😂 Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @joshytaco! 👋 Thanks for bearing with me, I was away from my computer for a week. Oh yeah, I think the documentation doesn't mention this indeed. tailwind-merge is just a normal runtime function, so the configuration should be wherever your runtime is. If you're using tailwind-merge in the browser, then just put it where your code that runs in the browser is. I usually create a file like import { extendTailwindMerge } from 'tailwind-merge'
export const twMerge = extendTailwindMerge({
// my config here
}) Then I import the By the way regarding your comment
tailwind-merge by default allows all classes that look like Tailwind classes, e.g. |
Beta Was this translation helpful? Give feedback.
Hey @joshytaco! 👋 Thanks for bearing with me, I was away from my computer for a week.
Oh yeah, I think the documentation doesn't mention this indeed. tailwind-merge is just a normal runtime function, so the configuration should be wherever your runtime is. If you're using tailwind-merge in the browser, then just put it where your code that runs in the browser is. I usually create a file like
tailwind-merge.ts
in a utils folder and then add this code to it:Then I import the
twMerge
function from that file wherever I need it.By the way regarding your comment