Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
a463553d
Unverified
Commit
a463553d
authored
May 24, 2022
by
Donny/강동윤
Committed by
GitHub
May 24, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update swc (#37149)
* Update swc * Update test refs * Update test refs
parent
76fbae93
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
128 additions
and
239 deletions
+128
-239
Cargo.lock
packages/next-swc/Cargo.lock
+18
-19
output.js
.../fixture/react-remove-properties/default/simple/output.js
+1
-2
output.js
...ts/tests/fixtures/transpile-css-prop-add-import/output.js
+1
-2
output.js
...ests/fixtures/transpile-css-prop-all-options-on/output.js
+34
-68
output.js
...ed_components/tests/fixtures/transpile-css-prop/output.js
+29
-58
output.js
...ext-swc/crates/styled_jsx/tests/errors/no-child/output.js
+1
-2
output.js
...swc/crates/styled_jsx/tests/errors/two-children/output.js
+1
-2
output.js
...crates/styled_jsx/tests/errors/wrong-child-type/output.js
+1
-2
output.js
...yled_jsx/tests/errors/wrong-jsx-expression-type/output.js
+1
-2
output.js
...next-swc/crates/styled_jsx/tests/fixture/absent/output.js
+1
-2
output.js
...ed_jsx/tests/fixture/attribute-generation-modes/output.js
+9
-18
output.js
...es/styled_jsx/tests/fixture/component-attribute/output.js
+1
-2
output.js
...ates/styled_jsx/tests/fixture/css-tag-same-file/output.js
+1
-2
output.js
...ates/styled_jsx/tests/fixture/different-jsx-ids/output.js
+3
-6
output.js
...swc/crates/styled_jsx/tests/fixture/expressions/output.js
+2
-4
output.js
...ed_jsx/tests/fixture/external-stylesheet-global/output.js
+1
-2
output.js
...sx/tests/fixture/external-stylesheet-multi-line/output.js
+1
-2
output.js
...es/styled_jsx/tests/fixture/external-stylesheet/output.js
+2
-4
output.js
...xt-swc/crates/styled_jsx/tests/fixture/fragment/output.js
+1
-2
output.js
.../styled_jsx/tests/fixture/global-child-selector/output.js
+1
-2
output.js
...next-swc/crates/styled_jsx/tests/fixture/global/output.js
+2
-4
output.js
...swc/crates/styled_jsx/tests/fixture/issue-30480/output.js
+1
-2
output.js
...es/styled_jsx/tests/fixture/mixed-global-scoped/output.js
+2
-4
output.js
...wc/crates/styled_jsx/tests/fixture/multiple-jsx/output.js
+3
-6
output.js
...s/styled_jsx/tests/fixture/non-styled-jsx-style/output.js
+1
-2
output.js
...yled_jsx/tests/fixture/one-off-global-selectors/output.js
+1
-2
output.js
...t-swc/crates/styled_jsx/tests/fixture/stateless/output.js
+1
-2
output.js
...sx/tests/fixture/transform-css-complex-selector/output.js
+1
-2
output.js
...s/styled_jsx/tests/fixture/transform-css-global/output.js
+1
-2
output.js
...led_jsx/tests/fixture/transform-css-media-query/output.js
+1
-2
output.js
...s/styled_jsx/tests/fixture/transform-css-normal/output.js
+1
-2
output.js
...es/styled_jsx/tests/fixture/transform-css-nth-1/output.js
+1
-2
output.js
...c/crates/styled_jsx/tests/fixture/transform-css/output.js
+1
-2
output.js
...-swc/crates/styled_jsx/tests/fixture/whitespace/output.js
+1
-2
No files found.
packages/next-swc/Cargo.lock
View file @
a463553d
...
@@ -2095,9 +2095,9 @@ dependencies = [
...
@@ -2095,9 +2095,9 @@ dependencies = [
[[package]]
[[package]]
name = "swc_css_parser"
name = "swc_css_parser"
version = "0.101.
2
"
version = "0.101.
3
"
source = "registry+https://github.com/rust-lang/crates.io-index"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "
10d358d2d301451cefddc231095c3f9431cf5bf0a2dad6833ce691d85d8e6b8f
"
checksum = "
537f2c9faace3ab931d10793c228ee9f7d510c97a4cdbaeb9dff6c3e5897c0e4
"
dependencies = [
dependencies = [
"bitflags",
"bitflags",
"lexical",
"lexical",
...
@@ -2164,9 +2164,9 @@ dependencies = [
...
@@ -2164,9 +2164,9 @@ dependencies = [
[[package]]
[[package]]
name = "swc_ecma_codegen"
name = "swc_ecma_codegen"
version = "0.108.
1
"
version = "0.108.
5
"
source = "registry+https://github.com/rust-lang/crates.io-index"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "
b65810646567ad2a34af1d90a0f51eaca250d220a7b50370f2a2dba834a375b4
"
checksum = "
4e4199b76335f78933b80621db130b58f711429986ed9917182b66cbb7c3778d
"
dependencies = [
dependencies = [
"bitflags",
"bitflags",
"memchr",
"memchr",
...
@@ -2253,9 +2253,9 @@ dependencies = [
...
@@ -2253,9 +2253,9 @@ dependencies = [
[[package]]
[[package]]
name = "swc_ecma_minifier"
name = "swc_ecma_minifier"
version = "0.114.1
0
"
version = "0.114.1
6
"
source = "registry+https://github.com/rust-lang/crates.io-index"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "
9c43e526a9441730cb75e84f3420cbb6c19be4530e0147f7de0f3c52743d15c9
"
checksum = "
c38c40604d06e1649c9f77d2df3c4a68b4f444e7448dc6a837c7ecf1be7e1a9d
"
dependencies = [
dependencies = [
"ahash",
"ahash",
"arrayvec",
"arrayvec",
...
@@ -2286,9 +2286,9 @@ dependencies = [
...
@@ -2286,9 +2286,9 @@ dependencies = [
[[package]]
[[package]]
name = "swc_ecma_parser"
name = "swc_ecma_parser"
version = "0.104.
0
"
version = "0.104.
2
"
source = "registry+https://github.com/rust-lang/crates.io-index"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "
efb97dc6efc95313dedc5158055cc811da77395ef7b54be61948b5ad097a3671
"
checksum = "
a5fea08aeb2eb1469928ac7ca2d208fe7816871787e4d93e34924495e724bb25
"
dependencies = [
dependencies = [
"either",
"either",
"enum_kind",
"enum_kind",
...
@@ -2301,7 +2301,6 @@ dependencies = [
...
@@ -2301,7 +2301,6 @@ dependencies = [
"swc_ecma_ast",
"swc_ecma_ast",
"tracing",
"tracing",
"typed-arena",
"typed-arena",
"unicode-id",
]
]
[[package]]
[[package]]
...
@@ -2351,9 +2350,9 @@ dependencies = [
...
@@ -2351,9 +2350,9 @@ dependencies = [
[[package]]
[[package]]
name = "swc_ecma_transforms_base"
name = "swc_ecma_transforms_base"
version = "0.85.
0
"
version = "0.85.
1
"
source = "registry+https://github.com/rust-lang/crates.io-index"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "
8262876d5387887776f23c4894fbddff26e5f184edadf2375f3dc19fca2b42a4
"
checksum = "
a1029b98240a2e87af924e5abe56b274110436670f12752c3978aae1fb6cb2ea
"
dependencies = [
dependencies = [
"better_scoped_tls",
"better_scoped_tls",
"once_cell",
"once_cell",
...
@@ -2386,9 +2385,9 @@ dependencies = [
...
@@ -2386,9 +2385,9 @@ dependencies = [
[[package]]
[[package]]
name = "swc_ecma_transforms_compat"
name = "swc_ecma_transforms_compat"
version = "0.99.
1
"
version = "0.99.
2
"
source = "registry+https://github.com/rust-lang/crates.io-index"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "
1144fe5347ef3bcb284bf66c94947ff58f6ac3bd7d468859d870e684af572181
"
checksum = "
299b629eb4c48fcb27760f760a7edde1f533e5f38f20f6a9eddc07b8a94b4ae7
"
dependencies = [
dependencies = [
"ahash",
"ahash",
"arrayvec",
"arrayvec",
...
@@ -2426,9 +2425,9 @@ dependencies = [
...
@@ -2426,9 +2425,9 @@ dependencies = [
[[package]]
[[package]]
name = "swc_ecma_transforms_module"
name = "swc_ecma_transforms_module"
version = "0.112.
2
"
version = "0.112.
6
"
source = "registry+https://github.com/rust-lang/crates.io-index"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "
6fc4ded6134ca3f31c918dd1b9772c3b2bdf2f8f83d782e4cf94c3e0016c4b41
"
checksum = "
727fc776ddc1a564486f13602f50f3e68c242555f644fdaffbbeeef0a788b2b3
"
dependencies = [
dependencies = [
"Inflector",
"Inflector",
"ahash",
"ahash",
...
@@ -2541,9 +2540,9 @@ dependencies = [
...
@@ -2541,9 +2540,9 @@ dependencies = [
[[package]]
[[package]]
name = "swc_ecma_transforms_typescript"
name = "swc_ecma_transforms_typescript"
version = "0.117.
0
"
version = "0.117.
2
"
source = "registry+https://github.com/rust-lang/crates.io-index"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "
fa8f32954c5a7c6bdead39c8a8a1580127a1759f33ef8b87d00f754882e6090a
"
checksum = "
96bf410ffcf91d85dc1f8f1bb969fa2637f9430a6917f2174ad76458c776cb89
"
dependencies = [
dependencies = [
"serde",
"serde",
"swc_atoms",
"swc_atoms",
...
@@ -2557,9 +2556,9 @@ dependencies = [
...
@@ -2557,9 +2556,9 @@ dependencies = [
[[package]]
[[package]]
name = "swc_ecma_utils"
name = "swc_ecma_utils"
version = "0.85.
0
"
version = "0.85.
1
"
source = "registry+https://github.com/rust-lang/crates.io-index"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "
dff9d469b284a48317a695a81346a9609d04ce3a31da4493aac508e0d48a4257
"
checksum = "
031ac49cf598f00f048fecd87b3bda5e14b86f6ccd561ada7fce461e0a3ea8d1
"
dependencies = [
dependencies = [
"indexmap",
"indexmap",
"once_cell",
"once_cell",
...
...
packages/next-swc/crates/core/tests/fixture/react-remove-properties/default/simple/output.js
View file @
a463553d
...
@@ -3,8 +3,7 @@ export default function Home() {
...
@@ -3,8 +3,7 @@ export default function Home() {
<
div
data
-
custom
=
"2"
>
<
div
data
-
custom
=
"2"
>
<
h1
nested
=
{()
=><
div
>
nested
<
/div
>
<
h1
nested
=
{()
=><
div
>
nested
<
/div>}>Hello World!</
h1
>
}
>
Hello
World
!<
/h1
>
<
/div
>
<
/div
>
...
...
packages/next-swc/crates/styled_components/tests/fixtures/transpile-css-prop-add-import/output.js
View file @
a463553d
...
@@ -21,8 +21,7 @@ export default (()=><_StyledDiv >
...
@@ -21,8 +21,7 @@ export default (()=><_StyledDiv >
<
/Card
>
<
/Card
>
<
/_StyledDiv
>
<
/_StyledDiv>
)
;
);
var
_StyledDiv
=
_styled
(
"div"
)
`
var
_StyledDiv
=
_styled
(
"div"
)
`
width: 35em;
width: 35em;
`
;
`
;
packages/next-swc/crates/styled_components/tests/fixtures/transpile-css-prop-all-options-on/output.js
View file @
a463553d
...
@@ -18,72 +18,55 @@ const Thing2 = styled(Thing).withConfig({
...
@@ -18,72 +18,55 @@ const Thing2 = styled(Thing).withConfig({
`
;
`
;
/*
/*
* Basic fixtures
* Basic fixtures
*/
const
StaticString
=
(
p
)
=><
_StyledP
>
A
<
/_StyledP
>
*/
const
StaticString
=
(
p
)
=><
_StyledP
>
A
<
/_StyledP>
;
;
const
StaticTemplate
=
(
p
)
=><
_StyledP2
>
const
StaticTemplate
=
(
p
)
=><
_StyledP2
>
A
A
<
/_StyledP2
>
<
/_StyledP2>
;
;
const
ObjectProp
=
(
p
)
=><
_StyledP3
>
A
<
/_StyledP3>
;
const
ObjectProp
=
(
p
)
=><
_StyledP3
>
A
<
/_StyledP3
>
const
NoChildren
=
(
p
)
=><
_StyledP4
/>
;
;
const
NoChildren
=
(
p
)
=><
_StyledP4
/>
;
const
CssHelperProp
=
(
p
)
=><
_StyledP5
>
const
CssHelperProp
=
(
p
)
=><
_StyledP5
>
A
A
<
/_StyledP5
>
<
/_StyledP5>
;
;
/*
/*
* Dynamic prop
* Dynamic prop
*/
const
CustomComp
=
(
p
)
=><
_StyledParagraph
>
H
<
/_StyledParagraph
>
*/
const
CustomComp
=
(
p
)
=><
_StyledParagraph
>
H
<
/_StyledParagraph>
;
;
const
DynamicProp
=
(
p
)
=><
_StyledP6
$_css
=
{
props
.
cssText
}
>
H
<
/_StyledP6>
;
const
DynamicProp
=
(
p
)
=><
_StyledP6
$_css
=
{
props
.
cssText
}
>
H
<
/_StyledP6
>
;
const
LocalInterpolation
=
(
p
)
=><
_StyledP7
$_css2
=
{
props
.
bg
}
>
const
LocalInterpolation
=
(
p
)
=><
_StyledP7
$_css2
=
{
props
.
bg
}
>
H
H
<
/_StyledP7
>
<
/_StyledP7>
;
;
const
FuncInterpolation
=
(
p
)
=><
_StyledP8
>
const
FuncInterpolation
=
(
p
)
=><
_StyledP8
>
H
H
<
/_StyledP8
>
<
/_StyledP8>
;
;
const
radius
=
10
;
const
radius
=
10
;
const
GlobalInterpolation
=
(
p
)
=><
_StyledP9
>
const
GlobalInterpolation
=
(
p
)
=><
_StyledP9
>
H
H
<
/_StyledP9
>
<
/_StyledP9>
;
;
const
LocalCssHelperProp
=
(
p
)
=><
_StyledP10
$_css3
=
{
p
.
color
}
>
const
LocalCssHelperProp
=
(
p
)
=><
_StyledP10
$_css3
=
{
p
.
color
}
>
A
A
<
/_StyledP10
>
<
/_StyledP10>
;
;
const
DynamicCssHelperProp
=
(
p
)
=><
_StyledP11
>
const
DynamicCssHelperProp
=
(
p
)
=><
_StyledP11
>
A
A
<
/_StyledP11
>
<
/_StyledP11>
;
;
const
CustomCompWithDot
=
(
p
)
=><
_StyledButtonGhost
>
H
<
/_StyledButtonGhost>
;
const
CustomCompWithDot
=
(
p
)
=><
_StyledButtonGhost
>
H
<
/_StyledButtonGhost
>
const
NestedCompWithDot
=
(
p
)
=><
_StyledButtonGhostNew
>
H
<
/_StyledButtonGhostNew>
;
;
const
CustomCompWithDotLowerCase
=
(
p
)
=><
_StyledButtonGhost2
>
H
<
/_StyledButtonGhost2>
;
const
NestedCompWithDot
=
(
p
)
=><
_StyledButtonGhostNew
>
H
<
/_StyledButtonGhostNew
>
const
CustomElement
=
(
p
)
=><
_StyledButtonGhost3
>
H
<
/_StyledButtonGhost3>
;
;
const
CustomCompWithDotLowerCase
=
(
p
)
=><
_StyledButtonGhost2
>
H
<
/_StyledButtonGhost2
>
;
const
CustomElement
=
(
p
)
=><
_StyledButtonGhost3
>
H
<
/_StyledButtonGhost3
>
;
const
globalVar
=
'"foo"'
;
const
globalVar
=
'"foo"'
;
const
getAfterValue
=
()
=>
'"bar"'
const
getAfterValue
=
()
=>
'"bar"'
;
;
const
ObjectPropMixedInputs
=
(
p
)
=>
{
const
ObjectPropMixedInputs
=
(
p
)
=>
{
const
color
=
'red'
;
const
color
=
'red'
;
return
<
_StyledP12
$_css4
=
{
p
.
background
}
$_css5
=
{
color
}
$_css6
=
{
globalVar
}
$_css7
=
{
getAfterValue
()}
>
return
<
_StyledP12
$_css4
=
{
p
.
background
}
$_css5
=
{
color
}
$_css6
=
{
globalVar
}
$_css7
=
{
getAfterValue
()}
>
...
@@ -100,8 +83,7 @@ const SpreadObjectPropMixedInputs = (p)=>{
...
@@ -100,8 +83,7 @@ const SpreadObjectPropMixedInputs = (p)=>{
<
/_StyledP13>
;
<
/_StyledP13>
;
};
};
/* styled component defined after function it's used in */
const
EarlyUsageComponent
=
(
p
)
=><
_StyledThing
/>
/* styled component defined after function it's used in */
const
EarlyUsageComponent
=
(
p
)
=><
_StyledThing
/>
;
;
const
Thing3
=
styled
.
div
.
withConfig
({
const
Thing3
=
styled
.
div
.
withConfig
({
displayName
:
"code__Thing3"
,
displayName
:
"code__Thing3"
,
componentId
:
"sc-867225be-2"
componentId
:
"sc-867225be-2"
...
@@ -112,34 +94,27 @@ var _StyledThing6 = _styled(Thing3)((p)=>({
...
@@ -112,34 +94,27 @@ var _StyledThing6 = _styled(Thing3)((p)=>({
[
p
.
$_css19
]:
{
[
p
.
$_css19
]:
{
color
:
'red'
color
:
'red'
}
}
})
}));
);
var
_StyledThing5
=
_styled
(
Thing3
)((
p
)
=>
({
var
_StyledThing5
=
_styled
(
Thing3
)((
p
)
=>
({
[
p
.
$_css18
]:
{
[
p
.
$_css18
]:
{
color
:
'red'
color
:
'red'
}
}
})
}));
);
var
_StyledThing4
=
_styled
(
Thing3
)((
p
)
=>
({
var
_StyledThing4
=
_styled
(
Thing3
)((
p
)
=>
({
[
p
.
$_css17
]:
{
[
p
.
$_css17
]:
{
color
:
'red'
color
:
'red'
}
}
})
}));
);
var
_StyledThing3
=
_styled
(
Thing3
)((
p
)
=>
({
var
_StyledThing3
=
_styled
(
Thing3
)((
p
)
=>
({
color
:
p
.
$_css16
color
:
p
.
$_css16
})
}));
);
var
_StyledThing
=
_styled
(
Thing3
)
`color: red;`
;
var
_StyledThing
=
_styled
(
Thing3
)
`color: red;`
;
const
EarlyUsageComponent2
=
(
p
)
=><
_StyledThing2
/>
const
EarlyUsageComponent2
=
(
p
)
=><
_StyledThing2
/>
;
;
function
Thing4
(
props
)
{
function
Thing4
(
props
)
{
return
<
div
{...
props
}
/>
;
return
<
div
{...
props
}
/>
;
}
}
/* insert before usage for non-local scope styled HOC targets */
const
ImportedComponentUsage
=
(
p
)
=><
_StyledSomeComponent
/>
/* insert before usage for non-local scope styled HOC targets */
const
ImportedComponentUsage
=
(
p
)
=><
_StyledSomeComponent
/>
;
;
const
RequiredComponentUsage
=
(
p
)
=><
_StyledSomeOtherComponent
/>
;
const
RequiredComponentUsage
=
(
p
)
=><
_StyledSomeOtherComponent
/>
;
const
ObjectInterpolation
=
(
p
)
=>
{
const
ObjectInterpolation
=
(
p
)
=>
{
const
theme
=
useTheme
();
const
theme
=
useTheme
();
return
<
_StyledP14
$_css15
=
{
theme
.
colors
.
red
}
>
return
<
_StyledP14
$_css15
=
{
theme
.
colors
.
red
}
>
...
@@ -205,26 +180,21 @@ var _StyledP5 = _styled("p")`
...
@@ -205,26 +180,21 @@ var _StyledP5 = _styled("p")`
color: blue;
color: blue;
`
;
`
;
var
_StyledParagraph
=
_styled
(
Paragraph
)
`flex: 1`
;
var
_StyledParagraph
=
_styled
(
Paragraph
)
`flex: 1`
;
var
_StyledP6
=
_styled
(
"p"
)
`
${(
p
)
=>
p
.
$_css
var
_StyledP6
=
_styled
(
"p"
)
`
${(
p
)
=>
p
.
$_css
}
`
;
}
`
;
var
_StyledP7
=
_styled
(
"p"
)
`
var
_StyledP7
=
_styled
(
"p"
)
`
background:
${(
p
)
=>
p
.
$_css2
background:
${(
p
)
=>
p
.
$_css2
}
;
}
;
`
;
`
;
var
_StyledP8
=
_styled
(
"p"
)
`
var
_StyledP8
=
_styled
(
"p"
)
`
color:
${(
props
)
=>
props
.
theme
.
a
color:
${(
props
)
=>
props
.
theme
.
a
}
;
}
;
`
;
`
;
var
_StyledP9
=
_styled
(
"p"
)
`
var
_StyledP9
=
_styled
(
"p"
)
`
border-radius:
${
radius
}
px;
border-radius:
${
radius
}
px;
`
;
`
;
var
_StyledP10
=
_styled
(
"p"
)
`
var
_StyledP10
=
_styled
(
"p"
)
`
color:
${(
p
)
=>
p
.
$_css3
color:
${(
p
)
=>
p
.
$_css3
}
;
}
;
`
;
`
;
var
_StyledP11
=
_styled
(
"p"
)
`
var
_StyledP11
=
_styled
(
"p"
)
`
color:
${(
props
)
=>
props
.
theme
.
color
color:
${(
props
)
=>
props
.
theme
.
color
}
;
}
;
`
;
`
;
var
_StyledButtonGhost
=
_styled
(
Button
.
Ghost
)
`flex: 1`
;
var
_StyledButtonGhost
=
_styled
(
Button
.
Ghost
)
`flex: 1`
;
var
_StyledButtonGhostNew
=
_styled
(
Button
.
Ghost
.
New
)
`flex: 1`
;
var
_StyledButtonGhostNew
=
_styled
(
Button
.
Ghost
.
New
)
`flex: 1`
;
...
@@ -240,8 +210,7 @@ var _StyledP12 = _styled("p")((p)=>({
...
@@ -240,8 +210,7 @@ var _StyledP12 = _styled("p")((p)=>({
'::after'
:
{
'::after'
:
{
content
:
p
.
$_css7
content
:
p
.
$_css7
}
}
})
}));
);
var
_StyledP13
=
_styled
(
"p"
)((
p
)
=>
({
var
_StyledP13
=
_styled
(
"p"
)((
p
)
=>
({
...{
...{
'::before'
:
{
'::before'
:
{
...
@@ -267,14 +236,11 @@ var _StyledP13 = _styled("p")((p)=>({
...
@@ -267,14 +236,11 @@ var _StyledP13 = _styled("p")((p)=>({
'::after'
:
{
'::after'
:
{
content
:
p
.
$_css14
content
:
p
.
$_css14
}
}
})
}));
);
var
_StyledP14
=
_styled
(
"p"
)((
p
)
=>
({
var
_StyledP14
=
_styled
(
"p"
)((
p
)
=>
({
color
:
p
.
$_css15
color
:
p
.
$_css15
})
}));
);
var
_StyledDiv
=
_styled
(
"div"
)((
p
)
=>
({
var
_StyledDiv
=
_styled
(
"div"
)((
p
)
=>
({
...
p
.
$_css20
,
...
p
.
$_css20
,
...
p
.
$_css21
...
p
.
$_css21
})
}));
);
packages/next-swc/crates/styled_components/tests/fixtures/transpile-css-prop/output.js
View file @
a463553d
import
_styled
from
"styled-components"
;
import
_styled
from
"styled-components"
;
/*
/*
* Basic fixtures
* Basic fixtures
*/
const
StaticString
=
(
p
)
=><
_StyledP
>
A
<
/_StyledP
>
*/
const
StaticString
=
(
p
)
=><
_StyledP
>
A
<
/_StyledP>
;
;
const
StaticTemplate
=
(
p
)
=><
_StyledP2
>
const
StaticTemplate
=
(
p
)
=><
_StyledP2
>
A
A
<
/_StyledP2
>
<
/_StyledP2>
;
;
const
ObjectProp
=
(
p
)
=><
_StyledP3
>
A
<
/_StyledP3>
;
const
ObjectProp
=
(
p
)
=><
_StyledP3
>
A
<
/_StyledP3
>
const
NoChildren
=
(
p
)
=><
_StyledP4
/>
;
;
const
NoChildren
=
(
p
)
=><
_StyledP4
/>
;
const
CssHelperProp
=
(
p
)
=><
_StyledP5
>
const
CssHelperProp
=
(
p
)
=><
_StyledP5
>
A
A
<
/_StyledP5
>
<
/_StyledP5>
;
;
/*
/*
* Dynamic prop
* Dynamic prop
*/
const
CustomComp
=
(
p
)
=><
_StyledParagraph
>
H
<
/_StyledParagraph
>
*/
const
CustomComp
=
(
p
)
=><
_StyledParagraph
>
H
<
/_StyledParagraph>
;
;
const
DynamicProp
=
(
p
)
=><
_StyledP6
$_css
=
{
props
.
cssText
}
>
H
<
/_StyledP6>
;
const
DynamicProp
=
(
p
)
=><
_StyledP6
$_css
=
{
props
.
cssText
}
>
H
<
/_StyledP6
>
;
const
LocalInterpolation
=
(
p
)
=><
_StyledP7
$_css2
=
{
props
.
bg
}
>
const
LocalInterpolation
=
(
p
)
=><
_StyledP7
$_css2
=
{
props
.
bg
}
>
H
H
<
/_StyledP7
>
<
/_StyledP7>
;
;
const
FuncInterpolation
=
(
p
)
=><
_StyledP8
>
const
FuncInterpolation
=
(
p
)
=><
_StyledP8
>
H
H
<
/_StyledP8
>
<
/_StyledP8>
;
;
const
radius
=
10
;
const
radius
=
10
;
const
GlobalInterpolation
=
(
p
)
=><
_StyledP9
>
const
GlobalInterpolation
=
(
p
)
=><
_StyledP9
>
H
H
<
/_StyledP9
>
<
/_StyledP9>
;
;
const
LocalCssHelperProp
=
(
p
)
=><
_StyledP10
$_css3
=
{
p
.
color
}
>
const
LocalCssHelperProp
=
(
p
)
=><
_StyledP10
$_css3
=
{
p
.
color
}
>
A
A
<
/_StyledP10
>
<
/_StyledP10>
;
;
const
DynamicCssHelperProp
=
(
p
)
=><
_StyledP11
>
const
DynamicCssHelperProp
=
(
p
)
=><
_StyledP11
>
A
A
<
/_StyledP11
>
<
/_StyledP11>
;
;
const
CustomCompWithDot
=
(
p
)
=><
_StyledButtonGhost
>
H
<
/_StyledButtonGhost>
;
const
CustomCompWithDot
=
(
p
)
=><
_StyledButtonGhost
>
H
<
/_StyledButtonGhost
>
const
NestedCompWithDot
=
(
p
)
=><
_StyledButtonGhostNew
>
H
<
/_StyledButtonGhostNew>
;
;
const
CustomCompWithDotLowerCase
=
(
p
)
=><
_StyledButtonGhost2
>
H
<
/_StyledButtonGhost2>
;
const
NestedCompWithDot
=
(
p
)
=><
_StyledButtonGhostNew
>
H
<
/_StyledButtonGhostNew
>
const
CustomElement
=
(
p
)
=><
_StyledButtonGhost3
>
H
<
/_StyledButtonGhost3>
;
;
/* styled component defined after function it's used in */
const
EarlyUsageComponent
=
(
p
)
=><
_StyledThing
/>
;
const
CustomCompWithDotLowerCase
=
(
p
)
=><
_StyledButtonGhost2
>
H
<
/_StyledButtonGhost2
>
;
const
CustomElement
=
(
p
)
=><
_StyledButtonGhost3
>
H
<
/_StyledButtonGhost3
>
;
/* styled component defined after function it's used in */
const
EarlyUsageComponent
=
(
p
)
=><
_StyledThing
/>
;
const
Thing3
=
styled
.
div
`
const
Thing3
=
styled
.
div
`
color: blue;
color: blue;
`
;
`
;
...
@@ -73,24 +56,20 @@ var _StyledThing5 = _styled(Thing3)((p)=>({
...
@@ -73,24 +56,20 @@ var _StyledThing5 = _styled(Thing3)((p)=>({
[
p
.
$_css8
]:
{
[
p
.
$_css8
]:
{
color
:
'red'
color
:
'red'
}
}
})
}));
);
var
_StyledThing4
=
_styled
(
Thing3
)((
p
)
=>
({
var
_StyledThing4
=
_styled
(
Thing3
)((
p
)
=>
({
[
p
.
$_css7
]:
{
[
p
.
$_css7
]:
{
color
:
'red'
color
:
'red'
}
}
})
}));
);
var
_StyledThing3
=
_styled
(
Thing3
)((
p
)
=>
({
var
_StyledThing3
=
_styled
(
Thing3
)((
p
)
=>
({
[
p
.
$_css6
]:
{
[
p
.
$_css6
]:
{
color
:
'red'
color
:
'red'
}
}
})
}));
);
var
_StyledThing2
=
_styled
(
Thing3
)((
p
)
=>
({
var
_StyledThing2
=
_styled
(
Thing3
)((
p
)
=>
({
color
:
p
.
$_css5
color
:
p
.
$_css5
})
}));
);
var
_StyledThing
=
_styled
(
Thing3
)
`color: red;`
;
var
_StyledThing
=
_styled
(
Thing3
)
`color: red;`
;
const
ObjectInterpolation
=
(
p
)
=>
{
const
ObjectInterpolation
=
(
p
)
=>
{
const
theme
=
useTheme
();
const
theme
=
useTheme
();
...
@@ -162,26 +141,21 @@ var _StyledP5 = _styled("p")`
...
@@ -162,26 +141,21 @@ var _StyledP5 = _styled("p")`
color: blue;
color: blue;
`
;
`
;
var
_StyledParagraph
=
_styled
(
Paragraph
)
`flex: 1`
;
var
_StyledParagraph
=
_styled
(
Paragraph
)
`flex: 1`
;
var
_StyledP6
=
_styled
(
"p"
)
`
${(
p
)
=>
p
.
$_css
var
_StyledP6
=
_styled
(
"p"
)
`
${(
p
)
=>
p
.
$_css
}
`
;
}
`
;
var
_StyledP7
=
_styled
(
"p"
)
`
var
_StyledP7
=
_styled
(
"p"
)
`
background:
${(
p
)
=>
p
.
$_css2
background:
${(
p
)
=>
p
.
$_css2
}
;
}
;
`
;
`
;
var
_StyledP8
=
_styled
(
"p"
)
`
var
_StyledP8
=
_styled
(
"p"
)
`
color:
${(
props
)
=>
props
.
theme
.
a
color:
${(
props
)
=>
props
.
theme
.
a
}
;
}
;
`
;
`
;
var
_StyledP9
=
_styled
(
"p"
)
`
var
_StyledP9
=
_styled
(
"p"
)
`
border-radius:
${
radius
}
px;
border-radius:
${
radius
}
px;
`
;
`
;
var
_StyledP10
=
_styled
(
"p"
)
`
var
_StyledP10
=
_styled
(
"p"
)
`
color:
${(
p
)
=>
p
.
$_css3
color:
${(
p
)
=>
p
.
$_css3
}
;
}
;
`
;
`
;
var
_StyledP11
=
_styled
(
"p"
)
`
var
_StyledP11
=
_styled
(
"p"
)
`
color:
${(
props
)
=>
props
.
theme
.
color
color:
${(
props
)
=>
props
.
theme
.
color
}
;
}
;
`
;
`
;
var
_StyledButtonGhost
=
_styled
(
Button
.
Ghost
)
`flex: 1`
;
var
_StyledButtonGhost
=
_styled
(
Button
.
Ghost
)
`flex: 1`
;
var
_StyledButtonGhostNew
=
_styled
(
Button
.
Ghost
.
New
)
`flex: 1`
;
var
_StyledButtonGhostNew
=
_styled
(
Button
.
Ghost
.
New
)
`flex: 1`
;
...
@@ -189,8 +163,7 @@ var _StyledButtonGhost2 = _styled(button.ghost)`flex: 1`;
...
@@ -189,8 +163,7 @@ var _StyledButtonGhost2 = _styled(button.ghost)`flex: 1`;
var
_StyledButtonGhost3
=
_styled
(
"button-ghost"
)
`flex: 1`
;
var
_StyledButtonGhost3
=
_styled
(
"button-ghost"
)
`flex: 1`
;
var
_StyledP12
=
_styled
(
"p"
)((
p
)
=>
({
var
_StyledP12
=
_styled
(
"p"
)((
p
)
=>
({
color
:
p
.
$_css4
color
:
p
.
$_css4
})
}));
);
var
_StyledP13
=
_styled
(
"p"
)((
p
)
=>
({
var
_StyledP13
=
_styled
(
"p"
)((
p
)
=>
({
background
:
p
.
$_css9
,
background
:
p
.
$_css9
,
color
:
p
.
$_css10
,
color
:
p
.
$_css10
,
...
@@ -201,10 +174,8 @@ var _StyledP13 = _styled("p")((p)=>({
...
@@ -201,10 +174,8 @@ var _StyledP13 = _styled("p")((p)=>({
'::after'
:
{
'::after'
:
{
content
:
p
.
$_css12
content
:
p
.
$_css12
}
}
})
}));
);
var
_StyledDiv
=
_styled
(
"div"
)((
p
)
=>
({
var
_StyledDiv
=
_styled
(
"div"
)((
p
)
=>
({
...
p
.
$_css13
,
...
p
.
$_css13
,
...
p
.
$_css14
...
p
.
$_css14
})
}));
);
packages/next-swc/crates/styled_jsx/tests/errors/no-child/output.js
View file @
a463553d
...
@@ -5,5 +5,4 @@ export default (()=><div >
...
@@ -5,5 +5,4 @@ export default (()=><div >
<
/style
>
<
/style
>
<
/div
>
<
/div>
)
;
);
packages/next-swc/crates/styled_jsx/tests/errors/two-children/output.js
View file @
a463553d
...
@@ -9,5 +9,4 @@ export default (()=><div >
...
@@ -9,5 +9,4 @@ export default (()=><div >
<
/style
>
<
/style
>
<
/div
>
<
/div>
)
;
);
packages/next-swc/crates/styled_jsx/tests/errors/wrong-child-type/output.js
View file @
a463553d
...
@@ -7,5 +7,4 @@ export default (()=><div >
...
@@ -7,5 +7,4 @@ export default (()=><div >
<
/style
>
<
/style
>
<
/div
>
<
/div>
)
;
);
packages/next-swc/crates/styled_jsx/tests/errors/wrong-jsx-expression-type/output.js
View file @
a463553d
...
@@ -7,5 +7,4 @@ export default (()=><div >
...
@@ -7,5 +7,4 @@ export default (()=><div >
<
/style
>
<
/style
>
<
/div
>
<
/div>
)
;
);
packages/next-swc/crates/styled_jsx/tests/fixture/absent/output.js
View file @
a463553d
...
@@ -4,5 +4,4 @@ const a = ()=><div >
...
@@ -4,5 +4,4 @@ const a = ()=><div >
<
style
>
{
'woot'
}
<
/style
>
<
style
>
{
'woot'
}
<
/style
>
<
/div
>
<
/div>
;
;
packages/next-swc/crates/styled_jsx/tests/fixture/attribute-generation-modes/output.js
View file @
a463553d
...
@@ -10,8 +10,7 @@ export const Test1 = ()=><div className={`jsx-${styles2.__hash} jsx-${styles.__h
...
@@ -10,8 +10,7 @@ export const Test1 = ()=><div className={`jsx-${styles2.__hash} jsx-${styles.__h
<
_JSXStyle
id
=
{
styles2
.
__hash
}
>
{
styles2
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
styles2
.
__hash
}
>
{
styles2
}
<
/_JSXStyle
>
<
/div
>
<
/div>
;
;
// external and static
// external and static
export
const
Test2
=
()
=><
div
className
=
{
"jsx-81a68341e430a972 "
+
`jsx-
${
styles
.
__hash
}
`
}
>
export
const
Test2
=
()
=><
div
className
=
{
"jsx-81a68341e430a972 "
+
`jsx-
${
styles
.
__hash
}
`
}
>
...
@@ -21,8 +20,7 @@ export const Test2 = ()=><div className={"jsx-81a68341e430a972 " + `jsx-${styles
...
@@ -21,8 +20,7 @@ export const Test2 = ()=><div className={"jsx-81a68341e430a972 " + `jsx-${styles
<
_JSXStyle
id
=
{
styles
.
__hash
}
>
{
styles
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
styles
.
__hash
}
>
{
styles
}
<
/_JSXStyle
>
<
/div
>
<
/div>
;
;
// external and dynamic
// external and dynamic
export
const
Test3
=
({
color
})
=><
div
className
=
{
`jsx-
${
styles
.
__hash
}
`
+
" "
+
_JSXStyle
.
dynamic
([
export
const
Test3
=
({
color
})
=><
div
className
=
{
`jsx-
${
styles
.
__hash
}
`
+
" "
+
_JSXStyle
.
dynamic
([
[
[
...
@@ -48,8 +46,7 @@ export const Test3 = ({ color })=><div className={`jsx-${styles.__hash}` + " "
...
@@ -48,8 +46,7 @@ export const Test3 = ({ color })=><div className={`jsx-${styles.__hash}` + " "
<
_JSXStyle
id
=
{
styles
.
__hash
}
>
{
styles
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
styles
.
__hash
}
>
{
styles
}
<
/_JSXStyle
>
<
/div
>
<
/div>
;
;
// external, static and dynamic
// external, static and dynamic
export
const
Test4
=
({
color
})
=><
div
className
=
{
`jsx-
${
styles
.
__hash
}
`
+
" jsx-ceba8c9ce34e3d0c "
+
_JSXStyle
.
dynamic
([
export
const
Test4
=
({
color
})
=><
div
className
=
{
`jsx-
${
styles
.
__hash
}
`
+
" jsx-ceba8c9ce34e3d0c "
+
_JSXStyle
.
dynamic
([
[
[
...
@@ -77,8 +74,7 @@ export const Test4 = ({ color })=><div className={`jsx-${styles.__hash}` + " js
...
@@ -77,8 +74,7 @@ export const Test4 = ({ color })=><div className={`jsx-${styles.__hash}` + " js
<
_JSXStyle
id
=
{
styles
.
__hash
}
>
{
styles
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
styles
.
__hash
}
>
{
styles
}
<
/_JSXStyle
>
<
/div
>
<
/div>
;
;
// static only
// static only
export
const
Test5
=
()
=><
div
className
=
{
"jsx-df0159ebd3f9fb6f"
}
>
export
const
Test5
=
()
=><
div
className
=
{
"jsx-df0159ebd3f9fb6f"
}
>
...
@@ -88,8 +84,7 @@ export const Test5 = ()=><div className={"jsx-df0159ebd3f9fb6f"}>
...
@@ -88,8 +84,7 @@ export const Test5 = ()=><div className={"jsx-df0159ebd3f9fb6f"}>
<
_JSXStyle
id
=
{
"81a68341e430a972"
}
>
{
"p.jsx-df0159ebd3f9fb6f{color:red}"
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
"81a68341e430a972"
}
>
{
"p.jsx-df0159ebd3f9fb6f{color:red}"
}
<
/_JSXStyle
>
<
/div
>
<
/div>
;
;
// static and dynamic
// static and dynamic
export
const
Test6
=
({
color
})
=><
div
className
=
{
"jsx-ceba8c9ce34e3d0c "
+
_JSXStyle
.
dynamic
([
export
const
Test6
=
({
color
})
=><
div
className
=
{
"jsx-ceba8c9ce34e3d0c "
+
_JSXStyle
.
dynamic
([
[
[
...
@@ -115,8 +110,7 @@ export const Test6 = ({ color })=><div className={"jsx-ceba8c9ce34e3d0c " + _JS
...
@@ -115,8 +110,7 @@ export const Test6 = ({ color })=><div className={"jsx-ceba8c9ce34e3d0c " + _JS
color
color
]}
>
{
`p.__jsx-style-dynamic-selector{color:
${
color
}
}`
}
<
/_JSXStyle
>
]}
>
{
`p.__jsx-style-dynamic-selector{color:
${
color
}
}`
}
<
/_JSXStyle
>
<
/div
>
<
/div>
;
;
// dynamic only
// dynamic only
export
const
Test7
=
({
color
})
=><
div
className
=
{
_JSXStyle
.
dynamic
([
export
const
Test7
=
({
color
})
=><
div
className
=
{
_JSXStyle
.
dynamic
([
[
[
...
@@ -140,8 +134,7 @@ export const Test7 = ({ color })=><div className={_JSXStyle.dynamic([
...
@@ -140,8 +134,7 @@ export const Test7 = ({ color })=><div className={_JSXStyle.dynamic([
color
color
]}
>
{
`p.__jsx-style-dynamic-selector{color:
${
color
}
}`
}
<
/_JSXStyle
>
]}
>
{
`p.__jsx-style-dynamic-selector{color:
${
color
}
}`
}
<
/_JSXStyle
>
<
/div
>
<
/div>
;
;
// dynamic with scoped compound variable
// dynamic with scoped compound variable
export
const
Test8
=
({
color
})
=>
{
export
const
Test8
=
({
color
})
=>
{
if
(
color
)
{
if
(
color
)
{
...
@@ -210,8 +203,7 @@ export const Test10 = ()=><div className={"jsx-cbdf2f44af4108bd"}>
...
@@ -210,8 +203,7 @@ export const Test10 = ()=><div className={"jsx-cbdf2f44af4108bd"}>
<
_JSXStyle
id
=
{
"cbdf2f44af4108bd"
}
>
{
`p.jsx-cbdf2f44af4108bd{color:
${
foo
}
}`
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
"cbdf2f44af4108bd"
}
>
{
`p.jsx-cbdf2f44af4108bd{color:
${
foo
}
}`
}
<
/_JSXStyle
>
<
/div
>
<
/div>
;
;
// dynamic with complex scope
// dynamic with complex scope
export
const
Test11
=
({
color
})
=>
{
export
const
Test11
=
({
color
})
=>
{
const
items
=
Array
.
from
({
const
items
=
Array
.
from
({
...
@@ -231,7 +223,6 @@ export const Test11 = ({ color })=>{
...
@@ -231,7 +223,6 @@ export const Test11 = ({ color })=>{
Item
#
{
i
+
1
}
Item
#
{
i
+
1
}
<
/li
>
<
/li>
)
;
);
return
<
ul
className
=
"items"
>
{
items
}
<
/ul>
;
return
<
ul
className
=
"items"
>
{
items
}
<
/ul>
;
};
};
packages/next-swc/crates/styled_jsx/tests/fixture/component-attribute/output.js
View file @
a463553d
...
@@ -7,5 +7,4 @@ const Test = ()=><div className={"jsx-a9535d7d5f32c3c4"}>
...
@@ -7,5 +7,4 @@ const Test = ()=><div className={"jsx-a9535d7d5f32c3c4"}>
<
_JSXStyle
id
=
{
"a9535d7d5f32c3c4"
}
>
{
"span.jsx-a9535d7d5f32c3c4{color:red}"
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
"a9535d7d5f32c3c4"
}
>
{
"span.jsx-a9535d7d5f32c3c4{color:red}"
}
<
/_JSXStyle
>
<
/div
>
<
/div>
;
;
packages/next-swc/crates/styled_jsx/tests/fixture/css-tag-same-file/output.js
View file @
a463553d
...
@@ -5,8 +5,7 @@ export default (({ children })=><div className={`jsx-${styles.__hash}`}>
...
@@ -5,8 +5,7 @@ export default (({ children })=><div className={`jsx-${styles.__hash}`}>
<
_JSXStyle
id
=
{
styles
.
__hash
}
>
{
styles
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
styles
.
__hash
}
>
{
styles
}
<
/_JSXStyle
>
<
/div
>
<
/div>
)
;
);
const
styles
=
new
String
(
"p.jsx-556239d258b6d66a{color:red}"
);
const
styles
=
new
String
(
"p.jsx-556239d258b6d66a{color:red}"
);
styles
.
__hash
=
"556239d258b6d66a"
;
styles
.
__hash
=
"556239d258b6d66a"
;
class
Test
extends
React
.
Component
{
class
Test
extends
React
.
Component
{
...
...
packages/next-swc/crates/styled_jsx/tests/fixture/different-jsx-ids/output.js
View file @
a463553d
...
@@ -7,21 +7,18 @@ const A = ()=><div className={"jsx-498d4e86e548e679"}>
...
@@ -7,21 +7,18 @@ const A = ()=><div className={"jsx-498d4e86e548e679"}>
<
_JSXStyle
id
=
{
"498d4e86e548e679"
}
>
{
`p.jsx-498d4e86e548e679{color:
${
color
}
}`
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
"498d4e86e548e679"
}
>
{
`p.jsx-498d4e86e548e679{color:
${
color
}
}`
}
<
/_JSXStyle
>
<
/div
>
<
/div>
;
;
const
B
=
()
=><
div
className
=
{
"jsx-d051a1c8140076ed"
}
>
const
B
=
()
=><
div
className
=
{
"jsx-d051a1c8140076ed"
}
>
<
p
className
=
{
"jsx-d051a1c8140076ed"
}
>
test
<
/p
>
<
p
className
=
{
"jsx-d051a1c8140076ed"
}
>
test
<
/p
>
<
_JSXStyle
id
=
{
"d051a1c8140076ed"
}
>
{
`p.jsx-d051a1c8140076ed{color:
${
otherColor
}
}`
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
"d051a1c8140076ed"
}
>
{
`p.jsx-d051a1c8140076ed{color:
${
otherColor
}
}`
}
<
/_JSXStyle
>
<
/div
>
<
/div>
;
;
export
default
(()
=><
div
>
export
default
(()
=><
div
>
<
A
/>
<
A
/>
<
B
/>
<
B
/>
<
/div
>
<
/div>
)
;
);
packages/next-swc/crates/styled_jsx/tests/fixture/expressions/output.js
View file @
a463553d
import
_JSXStyle
from
"next/dist/shared/lib/styled-jsx"
;
import
_JSXStyle
from
"next/dist/shared/lib/styled-jsx"
;
const
darken
=
(
c
)
=>
c
const
darken
=
(
c
)
=>
c
;
;
const
color
=
'red'
;
const
color
=
'red'
;
const
otherColor
=
'green'
;
const
otherColor
=
'green'
;
const
mediumScreen
=
'680px'
;
const
mediumScreen
=
'680px'
;
...
@@ -89,5 +88,4 @@ export default (({ display })=><div className={"jsx-ee922fe7eac00c5e " + _JSXSt
...
@@ -89,5 +88,4 @@ export default (({ display })=><div className={"jsx-ee922fe7eac00c5e " + _JSXSt
{}
{}
<
/div
>
<
/div>
)
;
);
packages/next-swc/crates/styled_jsx/tests/fixture/external-stylesheet-global/output.js
View file @
a463553d
...
@@ -15,5 +15,4 @@ export default (()=><div >
...
@@ -15,5 +15,4 @@ export default (()=><div >
<
_JSXStyle
id
=
{
styles
.
__hash
}
>
{
styles
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
styles
.
__hash
}
>
{
styles
}
<
/_JSXStyle
>
<
/div
>
<
/div>
)
;
);
packages/next-swc/crates/styled_jsx/tests/fixture/external-stylesheet-multi-line/output.js
View file @
a463553d
...
@@ -6,5 +6,4 @@ export default (()=><div className={`jsx-${styles.__hash}`}>
...
@@ -6,5 +6,4 @@ export default (()=><div className={`jsx-${styles.__hash}`}>
<
_JSXStyle
id
=
{
styles
.
__hash
}
>
{
styles
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
styles
.
__hash
}
>
{
styles
}
<
/_JSXStyle
>
<
/div
>
<
/div>
)
;
);
packages/next-swc/crates/styled_jsx/tests/fixture/external-stylesheet/output.js
View file @
a463553d
...
@@ -18,8 +18,7 @@ export default (()=><div className={"jsx-bee92b62eadf8a14 " + `jsx-${styles.__ha
...
@@ -18,8 +18,7 @@ export default (()=><div className={"jsx-bee92b62eadf8a14 " + `jsx-${styles.__ha
<
_JSXStyle
id
=
{
styles
.
__hash
}
>
{
styles
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
styles
.
__hash
}
>
{
styles
}
<
/_JSXStyle
>
<
/div
>
<
/div>
)
;
);
export
const
Test
=
()
=><
div
className
=
{
"jsx-bee92b62eadf8a14 "
+
`jsx-
${
styles3
.
__hash
}
`
}
>
export
const
Test
=
()
=><
div
className
=
{
"jsx-bee92b62eadf8a14 "
+
`jsx-
${
styles3
.
__hash
}
`
}
>
<
p
className
=
{
"jsx-bee92b62eadf8a14 "
+
`jsx-
${
styles3
.
__hash
}
`
+
" "
+
"foo"
}
>
test
<
/p
>
<
p
className
=
{
"jsx-bee92b62eadf8a14 "
+
`jsx-
${
styles3
.
__hash
}
`
+
" "
+
"foo"
}
>
test
<
/p
>
...
@@ -32,5 +31,4 @@ export const Test = ()=><div className={"jsx-bee92b62eadf8a14 " + `jsx-${styles3
...
@@ -32,5 +31,4 @@ export const Test = ()=><div className={"jsx-bee92b62eadf8a14 " + `jsx-${styles3
<
_JSXStyle
id
=
{
"bee92b62eadf8a14"
}
>
{
"p.jsx-bee92b62eadf8a14{color:red}div.jsx-bee92b62eadf8a14{color:green}"
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
"bee92b62eadf8a14"
}
>
{
"p.jsx-bee92b62eadf8a14{color:red}div.jsx-bee92b62eadf8a14{color:green}"
}
<
/_JSXStyle
>
<
/div
>
<
/div>
;
;
packages/next-swc/crates/styled_jsx/tests/fixture/fragment/output.js
View file @
a463553d
...
@@ -30,8 +30,7 @@ export default (()=><>
...
@@ -30,8 +30,7 @@ export default (()=><>
<
_JSXStyle
id
=
{
"6dd5f97e085c0297"
}
>
{
"p.jsx-6dd5f97e085c0297{color:cyan}.foo.jsx-6dd5f97e085c0297{font-size:18px;color:hotpink}#head.jsx-6dd5f97e085c0297{text-decoration:underline}"
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
"6dd5f97e085c0297"
}
>
{
"p.jsx-6dd5f97e085c0297{color:cyan}.foo.jsx-6dd5f97e085c0297{font-size:18px;color:hotpink}#head.jsx-6dd5f97e085c0297{text-decoration:underline}"
}
<
/_JSXStyle
>
<
/
>
<
/>
)
;
);
function
Component1
()
{
function
Component1
()
{
return
<>
return
<>
...
...
packages/next-swc/crates/styled_jsx/tests/fixture/global-child-selector/output.js
View file @
a463553d
...
@@ -5,5 +5,4 @@ const Test = ()=><div className={"jsx-5a206f122d1cb32e"}>
...
@@ -5,5 +5,4 @@ const Test = ()=><div className={"jsx-5a206f122d1cb32e"}>
<
_JSXStyle
id
=
{
"5a206f122d1cb32e"
}
>
{
"div.jsx-5a206f122d1cb32e>span{color:red}"
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
"5a206f122d1cb32e"
}
>
{
"div.jsx-5a206f122d1cb32e>span{color:red}"
}
<
/_JSXStyle
>
<
/div
>
<
/div>
;
;
packages/next-swc/crates/styled_jsx/tests/fixture/global/output.js
View file @
a463553d
...
@@ -3,7 +3,5 @@ const Test = ()=><div className={"jsx-d47d6adadf14e957"}>
...
@@ -3,7 +3,5 @@ const Test = ()=><div className={"jsx-d47d6adadf14e957"}>
<
_JSXStyle
id
=
{
"d47d6adadf14e957"
}
>
{
"body{color:red}:hover{color:red;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-animation:foo 1s ease-out;-moz-animation:foo 1s ease-out;-o-animation:foo 1s ease-out;animation:foo 1s ease-out}div a{display:none}[data-test]>div{color:red}"
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
"d47d6adadf14e957"
}
>
{
"body{color:red}:hover{color:red;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-animation:foo 1s ease-out;-moz-animation:foo 1s ease-out;-o-animation:foo 1s ease-out;animation:foo 1s ease-out}div a{display:none}[data-test]>div{color:red}"
}
<
/_JSXStyle
>
<
/div
>
<
/div>
;
;
const
Test2
=
()
=><
_JSXStyle
id
=
{
"94239b6d6b42c9b5"
}
>
{
"p{color:red}"
}
<
/_JSXStyle>
;
const
Test2
=
()
=><
_JSXStyle
id
=
{
"94239b6d6b42c9b5"
}
>
{
"p{color:red}"
}
<
/_JSXStyle
>
;
packages/next-swc/crates/styled_jsx/tests/fixture/issue-30480/output.js
View file @
a463553d
...
@@ -12,5 +12,4 @@ export default (({ breakPoint })=><div className={_JSXStyle.dynamic([
...
@@ -12,5 +12,4 @@ export default (({ breakPoint })=><div className={_JSXStyle.dynamic([
breakPoint
breakPoint
]}
>
{
`@media(
${
breakPoint
}
){}`
}
<
/_JSXStyle
>
]}
>
{
`@media(
${
breakPoint
}
){}`
}
<
/_JSXStyle
>
<
/div
>
<
/div>
)
;
);
packages/next-swc/crates/styled_jsx/tests/fixture/mixed-global-scoped/output.js
View file @
a463553d
import
_JSXStyle
from
"next/dist/shared/lib/styled-jsx"
;
import
_JSXStyle
from
"next/dist/shared/lib/styled-jsx"
;
const
Test
=
()
=><
_JSXStyle
id
=
{
"94239b6d6b42c9b5"
}
>
{
"p{color:red}"
}
<
/_JSXStyle
>
const
Test
=
()
=><
_JSXStyle
id
=
{
"94239b6d6b42c9b5"
}
>
{
"p{color:red}"
}
<
/_JSXStyle>
;
;
export
default
(()
=><
div
className
=
{
"jsx-3822e6e1fb9fa41a"
}
>
export
default
(()
=><
div
className
=
{
"jsx-3822e6e1fb9fa41a"
}
>
<
p
className
=
{
"jsx-3822e6e1fb9fa41a"
}
>
test
<
/p
>
<
p
className
=
{
"jsx-3822e6e1fb9fa41a"
}
>
test
<
/p
>
...
@@ -9,5 +8,4 @@ export default (()=><div className={"jsx-3822e6e1fb9fa41a"}>
...
@@ -9,5 +8,4 @@ export default (()=><div className={"jsx-3822e6e1fb9fa41a"}>
<
_JSXStyle
id
=
{
"94239b6d6b42c9b5"
}
>
{
"p.jsx-3822e6e1fb9fa41a{color:red}"
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
"94239b6d6b42c9b5"
}
>
{
"p.jsx-3822e6e1fb9fa41a{color:red}"
}
<
/_JSXStyle
>
<
/div
>
<
/div>
)
;
);
packages/next-swc/crates/styled_jsx/tests/fixture/multiple-jsx/output.js
View file @
a463553d
...
@@ -10,18 +10,15 @@ const Test1 = ()=><div className={"jsx-a9535d7d5f32c3c4"}>
...
@@ -10,18 +10,15 @@ const Test1 = ()=><div className={"jsx-a9535d7d5f32c3c4"}>
<
_JSXStyle
id
=
{
"a9535d7d5f32c3c4"
}
>
{
"span.jsx-a9535d7d5f32c3c4{color:red}"
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
"a9535d7d5f32c3c4"
}
>
{
"span.jsx-a9535d7d5f32c3c4{color:red}"
}
<
/_JSXStyle
>
<
/div
>
<
/div>
;
;
const
Test2
=
()
=><
span
>
test
<
/span>
;
const
Test2
=
()
=><
span
>
test
<
/span
>
;
const
Test3
=
()
=><
div
className
=
{
"jsx-a9535d7d5f32c3c4"
}
>
const
Test3
=
()
=><
div
className
=
{
"jsx-a9535d7d5f32c3c4"
}
>
<
span
className
=
{
"jsx-a9535d7d5f32c3c4"
}
>
test
<
/span
>
<
span
className
=
{
"jsx-a9535d7d5f32c3c4"
}
>
test
<
/span
>
<
_JSXStyle
id
=
{
"a9535d7d5f32c3c4"
}
>
{
"span.jsx-a9535d7d5f32c3c4{color:red}"
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
"a9535d7d5f32c3c4"
}
>
{
"span.jsx-a9535d7d5f32c3c4{color:red}"
}
<
/_JSXStyle
>
<
/div
>
<
/div>
;
;
export
default
class
{
export
default
class
{
render
()
{
render
()
{
return
<
div
className
=
{
"jsx-b2b86d63f35d25ee"
}
>
return
<
div
className
=
{
"jsx-b2b86d63f35d25ee"
}
>
...
...
packages/next-swc/crates/styled_jsx/tests/fixture/non-styled-jsx-style/output.js
View file @
a463553d
...
@@ -9,5 +9,4 @@ export default (()=><div className={"jsx-94239b6d6b42c9b5"}>
...
@@ -9,5 +9,4 @@ export default (()=><div className={"jsx-94239b6d6b42c9b5"}>
<
_JSXStyle
id
=
{
"94239b6d6b42c9b5"
}
>
{
"p.jsx-94239b6d6b42c9b5{color:red}"
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
"94239b6d6b42c9b5"
}
>
{
"p.jsx-94239b6d6b42c9b5{color:red}"
}
<
/_JSXStyle
>
<
/div
>
<
/div>
)
;
);
packages/next-swc/crates/styled_jsx/tests/fixture/one-off-global-selectors/output.js
View file @
a463553d
...
@@ -5,5 +5,4 @@ export default (()=><div className={"jsx-c7c3a8e231c9215a"}>
...
@@ -5,5 +5,4 @@ export default (()=><div className={"jsx-c7c3a8e231c9215a"}>
<
_JSXStyle
id
=
{
"c7c3a8e231c9215a"
}
>
{
".container.jsx-c7c3a8e231c9215a>*{color:red}"
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
"c7c3a8e231c9215a"
}
>
{
".container.jsx-c7c3a8e231c9215a>*{color:red}"
}
<
/_JSXStyle
>
<
/div
>
<
/div>
)
;
);
packages/next-swc/crates/styled_jsx/tests/fixture/stateless/output.js
View file @
a463553d
...
@@ -9,5 +9,4 @@ export default (()=><div className={"jsx-94239b6d6b42c9b5"}>
...
@@ -9,5 +9,4 @@ export default (()=><div className={"jsx-94239b6d6b42c9b5"}>
<
_JSXStyle
id
=
{
"94239b6d6b42c9b5"
}
>
{
"p.jsx-94239b6d6b42c9b5{color:red}"
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
"94239b6d6b42c9b5"
}
>
{
"p.jsx-94239b6d6b42c9b5{color:red}"
}
<
/_JSXStyle
>
<
/div
>
<
/div>
)
;
);
packages/next-swc/crates/styled_jsx/tests/fixture/transform-css-complex-selector/output.js
View file @
a463553d
...
@@ -5,5 +5,4 @@ export default (()=><div className={"jsx-713499aa363d6373"}>
...
@@ -5,5 +5,4 @@ export default (()=><div className={"jsx-713499aa363d6373"}>
<
_JSXStyle
id
=
{
"713499aa363d6373"
}
>
{
"p.jsx-713499aa363d6373 a.jsx-713499aa363d6373 span.jsx-713499aa363d6373{color:red}p.jsx-713499aa363d6373 span{background:blue}p.jsx-713499aa363d6373 a[title=
\"
'w ' ' t'
\"
].jsx-713499aa363d6373{margin:auto}p.jsx-713499aa363d6373 span:not(.test){color:green}p.jsx-713499aa363d6373,h1.jsx-713499aa363d6373{color:blue;-webkit-animation:hahaha 3s ease forwards infinite;-moz-animation:hahaha 3s ease forwards infinite;-o-animation:hahaha 3s ease forwards infinite;animation:hahaha 3s ease forwards infinite;-webkit-animation-name:hahaha;-moz-animation-name:hahaha;-o-animation-name:hahaha;animation-name:hahaha;-webkit-animation-delay:100ms;-moz-animation-delay:100ms;-o-animation-delay:100ms;animation-delay:100ms}p.jsx-713499aa363d6373{-webkit-animation:hahaha 1s,hehehe 2s;-moz-animation:hahaha 1s,hehehe 2s;-o-animation:hahaha 1s,hehehe 2s;animation:hahaha 1s,hehehe 2s}p.jsx-713499aa363d6373:hover{color:red}p.jsx-713499aa363d6373::before{color:red}.jsx-713499aa363d6373:hover{color:red}.jsx-713499aa363d6373::before{color:red}.jsx-713499aa363d6373:hover p.jsx-713499aa363d6373{color:red}p.jsx-713499aa363d6373+a.jsx-713499aa363d6373{color:red}p.jsx-713499aa363d6373~a.jsx-713499aa363d6373{color:red}p.jsx-713499aa363d6373>a.jsx-713499aa363d6373{color:red}@-webkit-keyframes hahaha{from{top:0}to{top:100}}@-moz-keyframes hahaha{from{top:0}to{top:100}}@-o-keyframes hahaha{from{top:0}to{top:100}}@keyframes hahaha{from{top:0}to{top:100}}@-webkit-keyframes hehehe{from{left:0}to{left:100}}@-moz-keyframes hehehe{from{left:0}to{left:100}}@-o-keyframes hehehe{from{left:0}to{left:100}}@keyframes hehehe{from{left:0}to{left:100}}@media(min-width:500px){.test.jsx-713499aa363d6373{color:red}}.test.jsx-713499aa363d6373{display:block}.inline-flex.jsx-713499aa363d6373{display:-webkit-inline-box;display:-webkit-inline-flex;display:-moz-inline-box;display:-ms-inline-flexbox;display:inline-flex}.flex.jsx-713499aa363d6373{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.test.jsx-713499aa363d6373{-webkit-box-shadow:0 0 10px black,inset 0 0 5px black;-moz-box-shadow:0 0 10px black,inset 0 0 5px black;box-shadow:0 0 10px black,inset 0 0 5px black}.test[title=
\"
,
\"
].jsx-713499aa363d6373{display:inline-block}.test.is-status.jsx-713499aa363d6373 .test.jsx-713499aa363d6373{color:red}.a-selector.jsx-713499aa363d6373:hover,.a-selector.jsx-713499aa363d6373:focus{outline:none}"
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
"713499aa363d6373"
}
>
{
"p.jsx-713499aa363d6373 a.jsx-713499aa363d6373 span.jsx-713499aa363d6373{color:red}p.jsx-713499aa363d6373 span{background:blue}p.jsx-713499aa363d6373 a[title=
\"
'w ' ' t'
\"
].jsx-713499aa363d6373{margin:auto}p.jsx-713499aa363d6373 span:not(.test){color:green}p.jsx-713499aa363d6373,h1.jsx-713499aa363d6373{color:blue;-webkit-animation:hahaha 3s ease forwards infinite;-moz-animation:hahaha 3s ease forwards infinite;-o-animation:hahaha 3s ease forwards infinite;animation:hahaha 3s ease forwards infinite;-webkit-animation-name:hahaha;-moz-animation-name:hahaha;-o-animation-name:hahaha;animation-name:hahaha;-webkit-animation-delay:100ms;-moz-animation-delay:100ms;-o-animation-delay:100ms;animation-delay:100ms}p.jsx-713499aa363d6373{-webkit-animation:hahaha 1s,hehehe 2s;-moz-animation:hahaha 1s,hehehe 2s;-o-animation:hahaha 1s,hehehe 2s;animation:hahaha 1s,hehehe 2s}p.jsx-713499aa363d6373:hover{color:red}p.jsx-713499aa363d6373::before{color:red}.jsx-713499aa363d6373:hover{color:red}.jsx-713499aa363d6373::before{color:red}.jsx-713499aa363d6373:hover p.jsx-713499aa363d6373{color:red}p.jsx-713499aa363d6373+a.jsx-713499aa363d6373{color:red}p.jsx-713499aa363d6373~a.jsx-713499aa363d6373{color:red}p.jsx-713499aa363d6373>a.jsx-713499aa363d6373{color:red}@-webkit-keyframes hahaha{from{top:0}to{top:100}}@-moz-keyframes hahaha{from{top:0}to{top:100}}@-o-keyframes hahaha{from{top:0}to{top:100}}@keyframes hahaha{from{top:0}to{top:100}}@-webkit-keyframes hehehe{from{left:0}to{left:100}}@-moz-keyframes hehehe{from{left:0}to{left:100}}@-o-keyframes hehehe{from{left:0}to{left:100}}@keyframes hehehe{from{left:0}to{left:100}}@media(min-width:500px){.test.jsx-713499aa363d6373{color:red}}.test.jsx-713499aa363d6373{display:block}.inline-flex.jsx-713499aa363d6373{display:-webkit-inline-box;display:-webkit-inline-flex;display:-moz-inline-box;display:-ms-inline-flexbox;display:inline-flex}.flex.jsx-713499aa363d6373{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.test.jsx-713499aa363d6373{-webkit-box-shadow:0 0 10px black,inset 0 0 5px black;-moz-box-shadow:0 0 10px black,inset 0 0 5px black;box-shadow:0 0 10px black,inset 0 0 5px black}.test[title=
\"
,
\"
].jsx-713499aa363d6373{display:inline-block}.test.is-status.jsx-713499aa363d6373 .test.jsx-713499aa363d6373{color:red}.a-selector.jsx-713499aa363d6373:hover,.a-selector.jsx-713499aa363d6373:focus{outline:none}"
}
<
/_JSXStyle
>
<
/div
>
<
/div>
)
;
);
packages/next-swc/crates/styled_jsx/tests/fixture/transform-css-global/output.js
View file @
a463553d
...
@@ -5,5 +5,4 @@ export default (()=><div className={"jsx-53fd644ab080300c"}>
...
@@ -5,5 +5,4 @@ export default (()=><div className={"jsx-53fd644ab080300c"}>
<
_JSXStyle
id
=
{
"53fd644ab080300c"
}
>
{
'html.jsx-53fd644ab080300c{background-image:-webkit-linear-gradient(bottom,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg);background-image:-moz-linear-gradient(bottom,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg);background-image:-o-linear-gradient(bottom,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg);background-image:linear-gradient(0deg,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg)}p{color:blue}p{color:blue}p,a.jsx-53fd644ab080300c{color:blue}.foo+a{color:red}body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif}'
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
"53fd644ab080300c"
}
>
{
'html.jsx-53fd644ab080300c{background-image:-webkit-linear-gradient(bottom,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg);background-image:-moz-linear-gradient(bottom,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg);background-image:-o-linear-gradient(bottom,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg);background-image:linear-gradient(0deg,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg)}p{color:blue}p{color:blue}p,a.jsx-53fd644ab080300c{color:blue}.foo+a{color:red}body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif}'
}
<
/_JSXStyle
>
<
/div
>
<
/div>
)
;
);
packages/next-swc/crates/styled_jsx/tests/fixture/transform-css-media-query/output.js
View file @
a463553d
...
@@ -5,5 +5,4 @@ export default (()=><div className={"jsx-1f7963ae04c6466a"}>
...
@@ -5,5 +5,4 @@ export default (()=><div className={"jsx-1f7963ae04c6466a"}>
<
_JSXStyle
id
=
{
"1f7963ae04c6466a"
}
>
{
'@media(min-width:1px)and (max-width:768px){[class*="grid__col--"].jsx-1f7963ae04c6466a{margin-top:12px;margin-bottom:12px}}@media(max-width:64em){.test.jsx-1f7963ae04c6466a{margin-bottom:1em}@supports(-moz-appearance:none)and (display:contents){.test.jsx-1f7963ae04c6466a{margin-bottom:2rem}}}'
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
"1f7963ae04c6466a"
}
>
{
'@media(min-width:1px)and (max-width:768px){[class*="grid__col--"].jsx-1f7963ae04c6466a{margin-top:12px;margin-bottom:12px}}@media(max-width:64em){.test.jsx-1f7963ae04c6466a{margin-bottom:1em}@supports(-moz-appearance:none)and (display:contents){.test.jsx-1f7963ae04c6466a{margin-bottom:2rem}}}'
}
<
/_JSXStyle
>
<
/div
>
<
/div>
)
;
);
packages/next-swc/crates/styled_jsx/tests/fixture/transform-css-normal/output.js
View file @
a463553d
...
@@ -5,5 +5,4 @@ export default (()=><div className={"jsx-1a19bb4817c105dd"}>
...
@@ -5,5 +5,4 @@ export default (()=><div className={"jsx-1a19bb4817c105dd"}>
<
_JSXStyle
id
=
{
"1a19bb4817c105dd"
}
>
{
'p.jsx-1a19bb4817c105dd{color:red}p.jsx-1a19bb4817c105dd{color:red}*.jsx-1a19bb4817c105dd{color:blue}[href="woot"].jsx-1a19bb4817c105dd{color:red}'
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
"1a19bb4817c105dd"
}
>
{
'p.jsx-1a19bb4817c105dd{color:red}p.jsx-1a19bb4817c105dd{color:red}*.jsx-1a19bb4817c105dd{color:blue}[href="woot"].jsx-1a19bb4817c105dd{color:red}'
}
<
/_JSXStyle
>
<
/div
>
<
/div>
)
;
);
packages/next-swc/crates/styled_jsx/tests/fixture/transform-css-nth-1/output.js
View file @
a463553d
...
@@ -5,5 +5,4 @@ export default (()=><div className={"jsx-938ca197692ef624"}>
...
@@ -5,5 +5,4 @@ export default (()=><div className={"jsx-938ca197692ef624"}>
<
_JSXStyle
id
=
{
"938ca197692ef624"
}
>
{
"li.jsx-938ca197692ef624:nth-child(2){color:lime}"
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
"938ca197692ef624"
}
>
{
"li.jsx-938ca197692ef624:nth-child(2){color:lime}"
}
<
/_JSXStyle
>
<
/div
>
<
/div>
)
;
);
packages/next-swc/crates/styled_jsx/tests/fixture/transform-css/output.js
View file @
a463553d
...
@@ -5,5 +5,4 @@ export default (()=><div className={"jsx-768337a97aceabd1"}>
...
@@ -5,5 +5,4 @@ export default (()=><div className={"jsx-768337a97aceabd1"}>
<
_JSXStyle
id
=
{
"768337a97aceabd1"
}
>
{
'html.jsx-768337a97aceabd1{background-image:-webkit-linear-gradient(bottom,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg);background-image:-moz-linear-gradient(bottom,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg);background-image:-o-linear-gradient(bottom,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg);background-image:linear-gradient(0deg,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg)}p{color:blue}p{color:blue}p,a.jsx-768337a97aceabd1{color:blue}.foo+a{color:red}body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif}p.jsx-768337a97aceabd1{color:red}p.jsx-768337a97aceabd1{color:red}*.jsx-768337a97aceabd1{color:blue}[href="woot"].jsx-768337a97aceabd1{color:red}p.jsx-768337a97aceabd1 a.jsx-768337a97aceabd1 span.jsx-768337a97aceabd1{color:red}p.jsx-768337a97aceabd1 span{background:blue}p.jsx-768337a97aceabd1 a[title="
\'
w
\'
\'
t
\'
"].jsx-768337a97aceabd1{margin:auto}p.jsx-768337a97aceabd1 span:not(.test){color:green}p.jsx-768337a97aceabd1,h1.jsx-768337a97aceabd1{color:blue;-webkit-animation:hahaha 3s ease forwards infinite;-moz-animation:hahaha 3s ease forwards infinite;-o-animation:hahaha 3s ease forwards infinite;animation:hahaha 3s ease forwards infinite;-webkit-animation-name:hahaha;-moz-animation-name:hahaha;-o-animation-name:hahaha;animation-name:hahaha;-webkit-animation-delay:100ms;-moz-animation-delay:100ms;-o-animation-delay:100ms;animation-delay:100ms}p.jsx-768337a97aceabd1{-webkit-animation:hahaha 1s,hehehe 2s;-moz-animation:hahaha 1s,hehehe 2s;-o-animation:hahaha 1s,hehehe 2s;animation:hahaha 1s,hehehe 2s}p.jsx-768337a97aceabd1:hover{color:red}p.jsx-768337a97aceabd1::before{color:red}.jsx-768337a97aceabd1:hover{color:red}.jsx-768337a97aceabd1::before{color:red}.jsx-768337a97aceabd1:hover p.jsx-768337a97aceabd1{color:red}p.jsx-768337a97aceabd1+a.jsx-768337a97aceabd1{color:red}p.jsx-768337a97aceabd1~a.jsx-768337a97aceabd1{color:red}p.jsx-768337a97aceabd1>a.jsx-768337a97aceabd1{color:red}@-webkit-keyframes hahaha{from{top:0}to{top:100}}@-moz-keyframes hahaha{from{top:0}to{top:100}}@-o-keyframes hahaha{from{top:0}to{top:100}}@keyframes hahaha{from{top:0}to{top:100}}@-webkit-keyframes hehehe{from{left:0}to{left:100}}@-moz-keyframes hehehe{from{left:0}to{left:100}}@-o-keyframes hehehe{from{left:0}to{left:100}}@keyframes hehehe{from{left:0}to{left:100}}@media(min-width:500px){.test.jsx-768337a97aceabd1{color:red}}.test.jsx-768337a97aceabd1{display:block}.inline-flex.jsx-768337a97aceabd1{display:-webkit-inline-box;display:-webkit-inline-flex;display:-moz-inline-box;display:-ms-inline-flexbox;display:inline-flex}.flex.jsx-768337a97aceabd1{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.test.jsx-768337a97aceabd1{-webkit-box-shadow:0 0 10px black,inset 0 0 5px black;-moz-box-shadow:0 0 10px black,inset 0 0 5px black;box-shadow:0 0 10px black,inset 0 0 5px black}.test[title=","].jsx-768337a97aceabd1{display:inline-block}.test.is-status.jsx-768337a97aceabd1 .test.jsx-768337a97aceabd1{color:red}.a-selector.jsx-768337a97aceabd1:hover,.a-selector.jsx-768337a97aceabd1:focus{outline:none}@media(min-width:1px)and (max-width:768px){[class*="grid__col--"].jsx-768337a97aceabd1{margin-top:12px;margin-bottom:12px}}@media(max-width:64em){.test.jsx-768337a97aceabd1{margin-bottom:1em}@supports(-moz-appearance:none)and (display:contents){.test.jsx-768337a97aceabd1{margin-bottom:2rem}}}'
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
"768337a97aceabd1"
}
>
{
'html.jsx-768337a97aceabd1{background-image:-webkit-linear-gradient(bottom,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg);background-image:-moz-linear-gradient(bottom,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg);background-image:-o-linear-gradient(bottom,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg);background-image:linear-gradient(0deg,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg)}p{color:blue}p{color:blue}p,a.jsx-768337a97aceabd1{color:blue}.foo+a{color:red}body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif}p.jsx-768337a97aceabd1{color:red}p.jsx-768337a97aceabd1{color:red}*.jsx-768337a97aceabd1{color:blue}[href="woot"].jsx-768337a97aceabd1{color:red}p.jsx-768337a97aceabd1 a.jsx-768337a97aceabd1 span.jsx-768337a97aceabd1{color:red}p.jsx-768337a97aceabd1 span{background:blue}p.jsx-768337a97aceabd1 a[title="
\'
w
\'
\'
t
\'
"].jsx-768337a97aceabd1{margin:auto}p.jsx-768337a97aceabd1 span:not(.test){color:green}p.jsx-768337a97aceabd1,h1.jsx-768337a97aceabd1{color:blue;-webkit-animation:hahaha 3s ease forwards infinite;-moz-animation:hahaha 3s ease forwards infinite;-o-animation:hahaha 3s ease forwards infinite;animation:hahaha 3s ease forwards infinite;-webkit-animation-name:hahaha;-moz-animation-name:hahaha;-o-animation-name:hahaha;animation-name:hahaha;-webkit-animation-delay:100ms;-moz-animation-delay:100ms;-o-animation-delay:100ms;animation-delay:100ms}p.jsx-768337a97aceabd1{-webkit-animation:hahaha 1s,hehehe 2s;-moz-animation:hahaha 1s,hehehe 2s;-o-animation:hahaha 1s,hehehe 2s;animation:hahaha 1s,hehehe 2s}p.jsx-768337a97aceabd1:hover{color:red}p.jsx-768337a97aceabd1::before{color:red}.jsx-768337a97aceabd1:hover{color:red}.jsx-768337a97aceabd1::before{color:red}.jsx-768337a97aceabd1:hover p.jsx-768337a97aceabd1{color:red}p.jsx-768337a97aceabd1+a.jsx-768337a97aceabd1{color:red}p.jsx-768337a97aceabd1~a.jsx-768337a97aceabd1{color:red}p.jsx-768337a97aceabd1>a.jsx-768337a97aceabd1{color:red}@-webkit-keyframes hahaha{from{top:0}to{top:100}}@-moz-keyframes hahaha{from{top:0}to{top:100}}@-o-keyframes hahaha{from{top:0}to{top:100}}@keyframes hahaha{from{top:0}to{top:100}}@-webkit-keyframes hehehe{from{left:0}to{left:100}}@-moz-keyframes hehehe{from{left:0}to{left:100}}@-o-keyframes hehehe{from{left:0}to{left:100}}@keyframes hehehe{from{left:0}to{left:100}}@media(min-width:500px){.test.jsx-768337a97aceabd1{color:red}}.test.jsx-768337a97aceabd1{display:block}.inline-flex.jsx-768337a97aceabd1{display:-webkit-inline-box;display:-webkit-inline-flex;display:-moz-inline-box;display:-ms-inline-flexbox;display:inline-flex}.flex.jsx-768337a97aceabd1{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.test.jsx-768337a97aceabd1{-webkit-box-shadow:0 0 10px black,inset 0 0 5px black;-moz-box-shadow:0 0 10px black,inset 0 0 5px black;box-shadow:0 0 10px black,inset 0 0 5px black}.test[title=","].jsx-768337a97aceabd1{display:inline-block}.test.is-status.jsx-768337a97aceabd1 .test.jsx-768337a97aceabd1{color:red}.a-selector.jsx-768337a97aceabd1:hover,.a-selector.jsx-768337a97aceabd1:focus{outline:none}@media(min-width:1px)and (max-width:768px){[class*="grid__col--"].jsx-768337a97aceabd1{margin-top:12px;margin-bottom:12px}}@media(max-width:64em){.test.jsx-768337a97aceabd1{margin-bottom:1em}@supports(-moz-appearance:none)and (display:contents){.test.jsx-768337a97aceabd1{margin-bottom:2rem}}}'
}
<
/_JSXStyle
>
<
/div
>
<
/div>
)
;
);
packages/next-swc/crates/styled_jsx/tests/fixture/whitespace/output.js
View file @
a463553d
...
@@ -9,5 +9,4 @@ export default (()=><div className={"jsx-94239b6d6b42c9b5"}>
...
@@ -9,5 +9,4 @@ export default (()=><div className={"jsx-94239b6d6b42c9b5"}>
<
_JSXStyle
id
=
{
"94239b6d6b42c9b5"
}
>
{
"p.jsx-94239b6d6b42c9b5{color:red}"
}
<
/_JSXStyle
>
<
_JSXStyle
id
=
{
"94239b6d6b42c9b5"
}
>
{
"p.jsx-94239b6d6b42c9b5{color:red}"
}
<
/_JSXStyle
>
<
/div
>
<
/div>
)
;
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment