-
Notifications
You must be signed in to change notification settings - Fork 27.6k
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
@media query interpolation broken in 12.0.4 #31562
Comments
cc @kdy1 who probably has the most context. |
Specifically, the next.js/packages/next-swc/crates/core/src/styled_jsx/transform_css.rs Lines 136 to 151 in 0f96308
|
Hey all -- just checking if there's any update on this. I've seen improvements around styled_jsx swc transforms but none seem to address this issue. It's blocking a few folks from upgrading to 12.0.4 1. Footnotes
|
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
What version of Next.js are you using?
12.0.4
What version of Node.js are you using?
v16.11.0
What browser are you using?
Chrome
What operating system are you using?
Windows
How are you deploying your application?
next dev
Describe the Bug
PR #31407 fixed #30480 but introduced a new issue where interpolated strings in media queries are sometimes unnecessarily parenthesized.
Consider this, which used to work in 12.0.3 and before:
And elsewhere in JSX:
Expected Behavior
This should compile into:
To Reproduce
Instead, in 12.0.4, it compiles into:
Notably, this should be
@media screen and (min-width: 700px) {}
rather than@media (screen and (min-width: 700px)) {}
.The text was updated successfully, but these errors were encountered: