mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
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.
28 lines
498 B
JavaScript
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>
|
|
</>
|
|
)
|
|
}
|