-
I have the following Svelte component. But it outputs no class and I'm not suer why. I appreciate any help.
|
Beta Was this translation helpful? Give feedback.
Answered by
dcastil
Jun 14, 2023
Replies: 2 comments 1 reply
-
Hey @shinokada! 👋 tailwind-merge doesn't support the object syntax (here more info on why). Does it work if you rewrite the call to twMerge(
footerType === 'sitemap' && 'bg-gray-800',
footerType === 'socialmedia' && 'p-4 bg-white sm:p-6 dark:bg-gray-800',
footerType === 'logo' && 'p-4 bg-white rounded-lg shadow md:px-6 md:py-8 dark:bg-gray-800',
footerType === 'default' &&
'p-4 bg-white rounded-lg shadow md:flex md:items-center md:justify-between md:p-6 dark:bg-gray-800',
$$props.class,
) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
shinokada
-
Thanks it works. |
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
Hey @shinokada! 👋
tailwind-merge doesn't support the object syntax (here more info on why).
Does it work if you rewrite the call to
twMerge
to this?