goober
goober copied to clipboard
Support interpolated objects
Hey Cristian
Would it be possible to add support for objects interpolated within template literals?
const Component = styled("div")`
/* An interpolated style object (unsupported) */
${{ display: "block" }};
/* An interpolated function returning a style object (supported) */
${() => ({ display: "block" })};
`
This feature would be great so people using twin can add styles like this:
const Component = styled("div")`
${tw`block`};
background-color: red;
`
Hi @ben-rogerson!
Actually that's a good point! I think we've played with this before 😅 and also recently I had a discussion about not being able to spread the props on tagged templates. With that being said, gonna add the support for this, asap.
That's awesome, thanks Christian 👍
The prop spreading would be a great feature too.