Skip to content

Inline element style with css and tw prop #330

Answered by ben-rogerson
Limunce asked this question in Q&A
Discussion options

You must be logged in to vote

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.
Perhaps I can sniff for a semicolon after the block and remove it with twin.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Limunce
Comment options

@ben-rogerson
Comment options

@Limunce
Comment options

Answer selected by Limunce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants