Files
Niklas MischkulnigandGitHub bdb1236037 Turbopack: remove css_environment from Environment (#83487)
Change the fix from #83334 to not have a "CSS environment" inside of every environment. I don't think that this makes sense, and it also makes the implementation more complicated.
```diff
  pub struct Environment {
    execution: ExecutionEnvironment,
+   css_environment: ResolvedVc<BrowserEnvironment>,
  }
```

Instead, we can just pass the client's `Environment` when we create the server's transform rules, to use the client's browserslist config for styled-jsx.

#83334 was also missing a test case

I recommend the review each commits individually.
2025-09-11 08:41:46 +02:00

28 lines
498 B
JavaScript

export default function Home() {
return (
<>
<div className="red-text">This text should be red.</div>
<StyledJsxTest />
</>
)
}
function StyledJsxTest() {
return (
<>
<div className="media-query-test">This text should be blue.</div>
<style jsx>{`
.media-query-test {
color: blue;
}
@media (max-width: 400px) {
.media-query-test {
color: orange;
}
}
`}</style>
</>
)
}