Is there a way to get only the CSS value of a Tailwind CSS class? For example, if I have translate-x-4
tailwind class I want only the 1rem
CSS value (since class translate-x-4
is --tw-translate-x: 1rem;
). This would be pretty useful with Framer Motion, because framer motion animation object can accept a wide variety of CSS values like 1rem
, #ff3322
. Is there some kind of way to do something like this <motion.div animate={{ x: getValue('translate-x-4') }} initial={false} />
.
I know there exists twin.macro but it "returns" entire Tailwind CSS class. Is there a similar utility for getting only the value?