Skip to content

Commit

Permalink
Fix @linaria/postcss-linaria cannot parse styled(Button)`` properly (#…
Browse files Browse the repository at this point in the history
…1329)

@linaria/postcss-linaria can not parse something like this:
```
styled(Button)`
  width: 50px;
`
```
  • Loading branch information
magicismight committed Nov 19, 2023
1 parent 74f6eb6 commit 58094c4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/postcss-linaria/src/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ export const parse: Parser<Root | Document> = (
extractedStyles.add(path.node);
}
}
if (path.node.tag.type === 'CallExpression') {
if (path.node.tag.callee.name === 'styled') {
extractedStyles.add(path.node);
}
}
},
});

Expand Down

0 comments on commit 58094c4

Please sign in to comment.