Usage with CVA #838
-
Is twin.macro supported when also using cva gives a great API to work with and manipulate classes, but when using it with tailwind you end up with a mash of a million class names, even for relatively simple components: Is it possible to utilize export const button = cva({
base: [
/* style */ tw`inline-flex min-h-control cursor-pointer items-center justify-center gap-2 rounded-md text-sm transition-colors`,
/* focus ring */ tw`ring-accent-focus-ring ring-offset-2 focus-visible:outline-none focus-visible:ring-2`,
/* disabled */ tw`disabled:pointer-events-none aria-disabled:pointer-events-none`,
],
}) P.S. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Unfortunately this won't work. |
Beta Was this translation helpful? Give feedback.
Unfortunately this won't work.
If twin was capable of converting the twin syntax (eg:
focus:(block mt-2)
) to tailwind classes rather than css objects then this would probably work.