Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@swc/plugin-styled-components difference in output from Babel #371

Open
RDIL opened this issue Nov 30, 2024 · 0 comments
Open

@swc/plugin-styled-components difference in output from Babel #371

RDIL opened this issue Nov 30, 2024 · 0 comments

Comments

@RDIL
Copy link

RDIL commented Nov 30, 2024

Describe the bug
Hi team,

I've recently been migrating my company's codebase from Babel to swc, and in the process, I've found a bug which was causing invalid code to be generated. It seems Babel was able to handle this case, but swc was not.

URL to minimal reproduction: https://gist.github.com/RDIL/94462a927acc6fcfd4e2fdbe8058b302

Expected behavior

It should output correct, valid CSS despite being a slightly invalid input.

If you change this line to:

&:not(:last-child) {

it works.

Correct output:
Screenshot 2024-11-29 at 10 11 16 PM

Incorrect output does not contain this CSS rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant