Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(next-swc/styled-jsx): Fix interpolation in media query (#32490)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
15ff1a3
commit 47cd07b
Showing
9 changed files
with
156 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
.../next-swc/crates/core/tests/fixture/styled-jsx/issue-31562-interpolation-in-mdea/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
|
||
|
||
export default class { | ||
render() { | ||
return ( | ||
<div> | ||
<p>test</p> | ||
<style jsx global>{` | ||
html { | ||
font-size: ${Typography.base.size.default}; | ||
line-height: ${Typography.base.lineHeight}; | ||
} | ||
@media ${Target.mediumPlus} { | ||
html { | ||
font-size: ${Typography.base.size.mediumPlus}; | ||
} | ||
} | ||
@media ${Target.largePlus} { | ||
html { | ||
font-size: ${Typography.base.size.largePlus}; | ||
} | ||
} | ||
`} | ||
</style> | ||
</div> | ||
) | ||
} | ||
} | ||
|
46 changes: 46 additions & 0 deletions
46
...next-swc/crates/core/tests/fixture/styled-jsx/issue-31562-interpolation-in-mdea/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import _JSXStyle from "styled-jsx/style"; | ||
export default class { | ||
render() { | ||
return <div className={_JSXStyle.dynamic([ | ||
[ | ||
"a876575397b32eda", | ||
[ | ||
Typography.base.size.default, | ||
Typography.base.lineHeight, | ||
Target.mediumPlus, | ||
Typography.base.size.mediumPlus, | ||
Target.largePlus, | ||
Typography.base.size.largePlus | ||
] | ||
] | ||
])}> | ||
|
||
<p className={_JSXStyle.dynamic([ | ||
[ | ||
"a876575397b32eda", | ||
[ | ||
Typography.base.size.default, | ||
Typography.base.lineHeight, | ||
Target.mediumPlus, | ||
Typography.base.size.mediumPlus, | ||
Target.largePlus, | ||
Typography.base.size.largePlus | ||
] | ||
] | ||
])}>test</p> | ||
|
||
<_JSXStyle id={"a876575397b32eda"} dynamic={[ | ||
Typography.base.size.default, | ||
Typography.base.lineHeight, | ||
Target.mediumPlus, | ||
Typography.base.size.mediumPlus, | ||
Target.largePlus, | ||
Typography.base.size.largePlus | ||
]}>{`html{font-size:${Typography.base.size.default}; | ||
line-height:${Typography.base.lineHeight}} | ||
@media ${Target.mediumPlus} {html{font-size:${Typography.base.size.mediumPlus}}} | ||
@media ${Target.largePlus} {html{font-size:${Typography.base.size.largePlus}}}`}</_JSXStyle> | ||
|
||
</div>; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters