ben-rogerson / twin.macro

🦹‍♂️ Twin blends the magic of Tailwind with the flexibility of css-in-js (emotion, styled-components, solid-styled-components, stitches and goober) at build time.
MIT License
7.89k stars 184 forks source link

Add support for styled-components v6 #818

Closed ben-rogerson closed 1 year ago

ben-rogerson commented 1 year ago

This PR adds support for styled-components v6 by setting the sassyPseudo option to true for the styled-components preset. Prefixing selectors like hover with an ampersand (eg: &:hover) were made a requirement in the latest version.

Another change is that when using styled, all props will be added to the element and you'll likely see a console warning. This isn't handled by twin so we'll need to use transient props to get around that.

Related #805