Inline element style with css and tw prop #330
-
Hello guys, I just run into a strange issue. I'm not able to style div element with css prop.
And the strange thing is that this happens only in some components 😕 The same code works as it should in another component. I'm using twin for a long time, and this is the first time I run on an issue like this. Does anyone know what is the problem here? Thank you in advance :) EDIT I cannot use the css prop like this
because I'm not using tw="..." prop anywhere in that component... @ben-rogerson Am I missing something or this is normal behavior? 😕 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The semicolon after the interpolated tw call is causing issues with the output (in styled-components). This works: <div
css={css`
${tw`block`}
margin-top: 5px;
`}
>
Tesst
</div>; I made some ordering changes a few versions ago so perhaps that's caused this. |
Beta Was this translation helpful? Give feedback.
The semicolon after the interpolated tw call is causing issues with the output (in styled-components).
This works:
I made some ordering changes a few versions ago so perhaps that's caused this.
Perhaps I can sniff for a semicolon after the block and remove it with twin.