Receiving Props & Passing them to Twin.Macro #286
-
I am trying to get the following component to work properly with Twin.Macro:
In other words, I would like to receive the props via the
And here is the css that is output:
As you can see, all it does is pass on the values of the tailwind css classes. It does not process those classes in the proper property-value pairs (such as position: absolute; left: -2px, etc). I have tried different ways to get this to work, but nothing has been successful. Any idea what I am doing wrong and how to fix it? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You'll just need to prefix the classes with tw before passing them through: <Pattern
classes={{
wrapper: tw`absolute -left-2 z-10 lg:left-0 top-0 h-full bg-contain bg-line-left-md lg:bg-line-left bg-no-repeat xl:bg-line-left-md hidden sm:block`,
img: tw`h-full`,
}}
/> |
Beta Was this translation helpful? Give feedback.
You'll just need to prefix the classes with tw before passing them through: