@swc/plugin-styled-jsx 1.5.76 → 1.5.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.toml +12 -11
- package/package.json +1 -1
- package/src/lib.rs +10 -3
- package/swc_plugin_styled_jsx.wasm +0 -0
- package/transform/Cargo.toml +19 -12
- package/transform/src/lib.rs +2 -1
- package/transform/src/style.rs +2 -1
- package/transform/src/{transform_css.rs → transform_css_lightningcss.rs} +5 -5
- package/transform/src/transform_css_swc.rs +392 -0
- package/transform/src/utils.rs +2 -1
- package/transform/src/visitor.rs +50 -21
- package/transform/tests/errors/nested-style-tags/output.js +31 -4
- package/transform/tests/errors/ts-with-css-resolve/output.js +1 -1
- package/transform/tests/fixture/absent/output.swc.js +7 -0
- package/transform/tests/fixture/attribute-generation-classname-rewriting/output.swc.js +112 -0
- package/transform/tests/fixture/attribute-generation-modes/output.swc.js +228 -0
- package/transform/tests/fixture/class/output.swc.js +12 -0
- package/transform/tests/fixture/comments/output.swc.js +12 -0
- package/transform/tests/fixture/component-attribute/output.swc.js +10 -0
- package/transform/tests/fixture/conflicts/output.swc.js +14 -0
- package/transform/tests/fixture/css-selector-after-pseudo/output.swc.js +11 -0
- package/transform/tests/fixture/css-tag-same-file/output.swc.js +21 -0
- package/transform/tests/fixture/different-jsx-ids/output.swc.js +24 -0
- package/transform/tests/fixture/dynamic-element/output.swc.js +40 -0
- package/transform/tests/fixture/dynamic-element-class/output.swc.js +25 -0
- package/transform/tests/fixture/dynamic-element-external/output.swc.js +12 -0
- package/transform/tests/fixture/dynamic-this-in-arrow/output.swc.js +39 -0
- package/transform/tests/fixture/exported-jsx-style/output.swc.js +1 -0
- package/transform/tests/fixture/exported-non-jsx-style/output.swc.js +1 -0
- package/transform/tests/fixture/external-nested-scope/output.swc.js +7 -0
- package/transform/tests/fixture/external-stylesheet/output.swc.js +34 -0
- package/transform/tests/fixture/external-stylesheet-global/output.swc.js +18 -0
- package/transform/tests/fixture/external-stylesheet-multi-line/output.swc.js +9 -0
- package/transform/tests/fixture/fragment/output.swc.js +47 -0
- package/transform/tests/fixture/global/output.swc.js +7 -0
- package/transform/tests/fixture/global-child-selector/output.swc.js +8 -0
- package/transform/tests/fixture/global-redundant/output.swc.js +10 -0
- package/transform/tests/fixture/issue-30480/output.swc.js +15 -0
- package/transform/tests/fixture/issue-30570/output.swc.js +12 -0
- package/transform/tests/fixture/issue-31562-interpolation-in-mdea/output.swc.js +43 -0
- package/transform/tests/fixture/mixed-global-scoped/output.swc.js +11 -0
- package/transform/tests/fixture/multiple-jsx/output.swc.js +32 -0
- package/transform/tests/fixture/next-54653/output.swc.js +3 -0
- package/transform/tests/fixture/non-styled-jsx-style/output.swc.js +12 -0
- package/transform/tests/fixture/not-styled-jsx-tagged-templates/{output.js → output.lightningcss.js} +1 -2
- package/transform/tests/fixture/not-styled-jsx-tagged-templates/output.swc.js +23 -0
- package/transform/tests/fixture/number-after-placeholder/output.swc.js +17 -0
- package/transform/tests/fixture/one-off-global-selectors/output.swc.js +8 -0
- package/transform/tests/fixture/source-maps/output.swc.js +8 -0
- package/transform/tests/fixture/styles/output.swc.js +39 -0
- package/transform/tests/fixture/styles-external-invalid/output.swc.js +9 -0
- package/transform/tests/fixture/styles-external-invalid2/output.swc.js +8 -0
- package/transform/tests/fixture/styles2/output.swc.js +5 -0
- package/transform/tests/fixture/too-many/output.swc.js +49 -0
- package/transform/tests/fixture/tpl-escape-1/output.swc.js +12 -0
- package/transform/tests/fixture/tpl-escape-2/output.swc.js +17 -0
- package/transform/tests/fixture/tpl-placeholder-1-as-property/output.swc.js +28 -0
- package/transform/tests/fixture/tpl-placeholder-2-as-part-of-value/output.swc.js +34 -0
- package/transform/tests/fixture/tpl-placeholder-3-as-value/output.swc.js +28 -0
- package/transform/tests/fixture/tpl-placeholder-4-as-part-of-value-in-multiple/output.swc.js +31 -0
- package/transform/tests/fixture/tpl-placeholder-5-values-of-multiple-properties/output.swc.js +31 -0
- package/transform/tests/fixture/transform-css/output.swc.js +8 -0
- package/transform/tests/fixture/transform-css-complex-selector/output.swc.js +8 -0
- package/transform/tests/fixture/transform-css-complex-selector-2/output.swc.js +8 -0
- package/transform/tests/fixture/transform-css-global/output.swc.js +8 -0
- package/transform/tests/fixture/transform-css-media-query/output.swc.js +8 -0
- package/transform/tests/fixture/transform-css-normal/output.swc.js +8 -0
- package/transform/tests/fixture/transform-css-nth-1/output.swc.js +8 -0
- package/transform/tests/fixture/whitespace/output.lightningcss.js +12 -0
- package/transform/tests/fixture/whitespace/output.swc.js +12 -0
- package/transform/tests/fixture.rs +60 -49
- package/transform/tests/fixture/.expressions/output.js +0 -91
- package/transform/tests/fixture/nested-style-tags/output.js +0 -0
- /package/transform/tests/fixture/absent/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/attribute-generation-classname-rewriting/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/attribute-generation-modes/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/class/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/comments/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/component-attribute/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/conflicts/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/css-selector-after-pseudo/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/css-tag-same-file/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/different-jsx-ids/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/dynamic-element/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/dynamic-element-class/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/dynamic-element-external/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/dynamic-this-in-arrow/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/exported-jsx-style/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/exported-non-jsx-style/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/external-nested-scope/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/external-stylesheet/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/external-stylesheet-global/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/external-stylesheet-multi-line/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/fragment/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/global/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/global-child-selector/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/global-redundant/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/issue-30480/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/issue-30570/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/issue-31562-interpolation-in-mdea/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/mixed-global-scoped/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/multiple-jsx/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/next-54653/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/non-styled-jsx-style/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/number-after-placeholder/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/one-off-global-selectors/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/source-maps/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/stateless/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/{whitespace/output.js → stateless/output.swc.js} +0 -0
- /package/transform/tests/fixture/styles/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/styles-external-invalid/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/styles-external-invalid2/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/styles2/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/too-many/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/tpl-escape-1/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/tpl-escape-2/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/tpl-placeholder-1-as-property/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/tpl-placeholder-2-as-part-of-value/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/tpl-placeholder-3-as-value/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/tpl-placeholder-4-as-part-of-value-in-multiple/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/tpl-placeholder-5-values-of-multiple-properties/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/transform-css/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/transform-css-complex-selector/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/transform-css-complex-selector-2/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/transform-css-global/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/transform-css-media-query/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/transform-css-normal/{output.js → output.lightningcss.js} +0 -0
- /package/transform/tests/fixture/transform-css-nth-1/{output.js → output.lightningcss.js} +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
import styles from './styles';
|
|
3
|
+
const styles2 = require('./styles2');
|
|
4
|
+
import { foo as styles3 } from './styles';
|
|
5
|
+
export default (()=><div className={"jsx-bee92b62eadf8a14 " + `jsx-${styles.__hash} jsx-${styles3.__hash}`}>
|
|
6
|
+
|
|
7
|
+
<p className={"jsx-bee92b62eadf8a14 " + `jsx-${styles.__hash} jsx-${styles3.__hash}` + " " + "foo"}>test</p>
|
|
8
|
+
|
|
9
|
+
<p className={"jsx-bee92b62eadf8a14 " + `jsx-${styles.__hash} jsx-${styles3.__hash}`}>woot</p>
|
|
10
|
+
|
|
11
|
+
<_JSXStyle id={styles2.__hash}>{styles2}</_JSXStyle>
|
|
12
|
+
|
|
13
|
+
<_JSXStyle id={styles3.__hash}>{styles3}</_JSXStyle>
|
|
14
|
+
|
|
15
|
+
<div className={"jsx-bee92b62eadf8a14 " + `jsx-${styles.__hash} jsx-${styles3.__hash}`}>woot</div>
|
|
16
|
+
|
|
17
|
+
<_JSXStyle id={"bee92b62eadf8a14"}>{"p.jsx-bee92b62eadf8a14{color:red}div.jsx-bee92b62eadf8a14{color:green}"}</_JSXStyle>
|
|
18
|
+
|
|
19
|
+
<_JSXStyle id={styles.__hash}>{styles}</_JSXStyle>
|
|
20
|
+
|
|
21
|
+
</div>);
|
|
22
|
+
export const Test = ()=><div className={"jsx-bee92b62eadf8a14 " + `jsx-${styles3.__hash}`}>
|
|
23
|
+
|
|
24
|
+
<p className={"jsx-bee92b62eadf8a14 " + `jsx-${styles3.__hash}` + " " + "foo"}>test</p>
|
|
25
|
+
|
|
26
|
+
<p className={"jsx-bee92b62eadf8a14 " + `jsx-${styles3.__hash}`}>woot</p>
|
|
27
|
+
|
|
28
|
+
<_JSXStyle id={styles3.__hash}>{styles3}</_JSXStyle>
|
|
29
|
+
|
|
30
|
+
<div className={"jsx-bee92b62eadf8a14 " + `jsx-${styles3.__hash}`}>woot</div>
|
|
31
|
+
|
|
32
|
+
<_JSXStyle id={"bee92b62eadf8a14"}>{"p.jsx-bee92b62eadf8a14{color:red}div.jsx-bee92b62eadf8a14{color:green}"}</_JSXStyle>
|
|
33
|
+
|
|
34
|
+
</div>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
import styles, { foo as styles3 } from './styles';
|
|
3
|
+
const styles2 = require('./styles2');
|
|
4
|
+
export default (()=><div>
|
|
5
|
+
|
|
6
|
+
<p>test</p>
|
|
7
|
+
|
|
8
|
+
<div>woot</div>
|
|
9
|
+
|
|
10
|
+
<p>woot</p>
|
|
11
|
+
|
|
12
|
+
<_JSXStyle id={styles2.__hash}>{styles2}</_JSXStyle>
|
|
13
|
+
|
|
14
|
+
<_JSXStyle id={styles3.__hash}>{styles3}</_JSXStyle>
|
|
15
|
+
|
|
16
|
+
<_JSXStyle id={styles.__hash}>{styles}</_JSXStyle>
|
|
17
|
+
|
|
18
|
+
</div>);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export default (()=><>
|
|
4
|
+
|
|
5
|
+
<p className={"jsx-6dd5f97e085c0297"}>Testing!!!</p>
|
|
6
|
+
|
|
7
|
+
<p className={"jsx-6dd5f97e085c0297" + " " + "foo"}>Bar</p>
|
|
8
|
+
|
|
9
|
+
<>
|
|
10
|
+
|
|
11
|
+
<h3 id="head" className={"jsx-6dd5f97e085c0297"}>Title...</h3>
|
|
12
|
+
|
|
13
|
+
<React.Fragment>
|
|
14
|
+
|
|
15
|
+
<p className={"jsx-6dd5f97e085c0297"}>hello</p>
|
|
16
|
+
|
|
17
|
+
<>
|
|
18
|
+
|
|
19
|
+
<p className={"jsx-6dd5f97e085c0297"}>foo</p>
|
|
20
|
+
|
|
21
|
+
<p className={"jsx-6dd5f97e085c0297"}>bar</p>
|
|
22
|
+
|
|
23
|
+
</>
|
|
24
|
+
|
|
25
|
+
<p className={"jsx-6dd5f97e085c0297"}>world</p>
|
|
26
|
+
|
|
27
|
+
</React.Fragment>
|
|
28
|
+
|
|
29
|
+
</>
|
|
30
|
+
|
|
31
|
+
<_JSXStyle id={"6dd5f97e085c0297"}>{"p.jsx-6dd5f97e085c0297{color:cyan}.foo.jsx-6dd5f97e085c0297{font-size:18px;color:hotpink}#head.jsx-6dd5f97e085c0297{text-decoration:underline}"}</_JSXStyle>
|
|
32
|
+
|
|
33
|
+
</>);
|
|
34
|
+
function Component1() {
|
|
35
|
+
return <>
|
|
36
|
+
|
|
37
|
+
<div>test</div>
|
|
38
|
+
|
|
39
|
+
</>;
|
|
40
|
+
}
|
|
41
|
+
function Component2() {
|
|
42
|
+
return <div className={"jsx-678f41ca6d3b294b"}>
|
|
43
|
+
|
|
44
|
+
<_JSXStyle id={"678f41ca6d3b294b"}>{"div.jsx-678f41ca6d3b294b{color:red}"}</_JSXStyle>
|
|
45
|
+
|
|
46
|
+
</div>;
|
|
47
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
const Test = ()=><div className={"jsx-d47d6adadf14e957"}>
|
|
3
|
+
|
|
4
|
+
<_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>
|
|
5
|
+
|
|
6
|
+
</div>;
|
|
7
|
+
const Test2 = ()=><_JSXStyle id={"94239b6d6b42c9b5"}>{"p{color:red}"}</_JSXStyle>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
const Test = ()=><div className={"jsx-5a206f122d1cb32e"}>
|
|
3
|
+
|
|
4
|
+
<span className={"jsx-5a206f122d1cb32e"}>test</span>
|
|
5
|
+
|
|
6
|
+
<_JSXStyle id={"5a206f122d1cb32e"}>{"div.jsx-5a206f122d1cb32e>span{color:red}"}</_JSXStyle>
|
|
7
|
+
|
|
8
|
+
</div>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
export default (({ breakPoint })=><div className={_JSXStyle.dynamic([
|
|
3
|
+
[
|
|
4
|
+
"ff798a455a83a572",
|
|
5
|
+
[
|
|
6
|
+
breakPoint
|
|
7
|
+
]
|
|
8
|
+
]
|
|
9
|
+
])}>
|
|
10
|
+
|
|
11
|
+
<_JSXStyle id={"ff798a455a83a572"} dynamic={[
|
|
12
|
+
breakPoint
|
|
13
|
+
]}>{`@media(${breakPoint}){.test.__jsx-style-dynamic-selector{margin-bottom:1em}}`}</_JSXStyle>
|
|
14
|
+
|
|
15
|
+
</div>);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
export default function IndexPage() {
|
|
3
|
+
return <div className={"jsx-bbdada4ef17d18ef"}>
|
|
4
|
+
|
|
5
|
+
<h1 className={"jsx-bbdada4ef17d18ef"}>Hello World.</h1>
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<_JSXStyle id={"bbdada4ef17d18ef"}>{"@supports((display:flex)or (display:-webkit-box)or (display:-webkit-flex)or (display:-moz-box)or (display:-ms-flexbox)){h1{color:hotpink}}"}</_JSXStyle>
|
|
10
|
+
|
|
11
|
+
</div>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
export default class {
|
|
3
|
+
render() {
|
|
4
|
+
return <div className={_JSXStyle.dynamic([
|
|
5
|
+
[
|
|
6
|
+
"60bda1963c17b640",
|
|
7
|
+
[
|
|
8
|
+
Typography.base.size.default,
|
|
9
|
+
Typography.base.lineHeight,
|
|
10
|
+
Target.mediumPlus,
|
|
11
|
+
Typography.base.size.mediumPlus,
|
|
12
|
+
Target.largePlus,
|
|
13
|
+
Typography.base.size.largePlus
|
|
14
|
+
]
|
|
15
|
+
]
|
|
16
|
+
])}>
|
|
17
|
+
|
|
18
|
+
<p className={_JSXStyle.dynamic([
|
|
19
|
+
[
|
|
20
|
+
"60bda1963c17b640",
|
|
21
|
+
[
|
|
22
|
+
Typography.base.size.default,
|
|
23
|
+
Typography.base.lineHeight,
|
|
24
|
+
Target.mediumPlus,
|
|
25
|
+
Typography.base.size.mediumPlus,
|
|
26
|
+
Target.largePlus,
|
|
27
|
+
Typography.base.size.largePlus
|
|
28
|
+
]
|
|
29
|
+
]
|
|
30
|
+
])}>test</p>
|
|
31
|
+
|
|
32
|
+
<_JSXStyle id={"60bda1963c17b640"} dynamic={[
|
|
33
|
+
Typography.base.size.default,
|
|
34
|
+
Typography.base.lineHeight,
|
|
35
|
+
Target.mediumPlus,
|
|
36
|
+
Typography.base.size.mediumPlus,
|
|
37
|
+
Target.largePlus,
|
|
38
|
+
Typography.base.size.largePlus
|
|
39
|
+
]}>{`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>
|
|
40
|
+
|
|
41
|
+
</div>;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
const Test = ()=><_JSXStyle id={"94239b6d6b42c9b5"}>{"p{color:red}"}</_JSXStyle>;
|
|
3
|
+
export default (()=><div className={"jsx-3822e6e1fb9fa41a"}>
|
|
4
|
+
|
|
5
|
+
<p className={"jsx-3822e6e1fb9fa41a"}>test</p>
|
|
6
|
+
|
|
7
|
+
<_JSXStyle id={"b7efb453c85593c1"}>{"body{background:red}"}</_JSXStyle>
|
|
8
|
+
|
|
9
|
+
<_JSXStyle id={"94239b6d6b42c9b5"}>{"p.jsx-3822e6e1fb9fa41a{color:red}"}</_JSXStyle>
|
|
10
|
+
|
|
11
|
+
</div>);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
const attrs = {
|
|
3
|
+
id: 'test'
|
|
4
|
+
};
|
|
5
|
+
const Test1 = ()=><div className={"jsx-a9535d7d5f32c3c4"}>
|
|
6
|
+
|
|
7
|
+
<span {...attrs} data-test="test" className={"jsx-a9535d7d5f32c3c4" + " " + (attrs && attrs.className != null && attrs.className || "")}>test</span>
|
|
8
|
+
|
|
9
|
+
<Component/>
|
|
10
|
+
|
|
11
|
+
<_JSXStyle id={"a9535d7d5f32c3c4"}>{"span.jsx-a9535d7d5f32c3c4{color:red}"}</_JSXStyle>
|
|
12
|
+
|
|
13
|
+
</div>;
|
|
14
|
+
const Test2 = ()=><span>test</span>;
|
|
15
|
+
const Test3 = ()=><div className={"jsx-a9535d7d5f32c3c4"}>
|
|
16
|
+
|
|
17
|
+
<span className={"jsx-a9535d7d5f32c3c4"}>test</span>
|
|
18
|
+
|
|
19
|
+
<_JSXStyle id={"a9535d7d5f32c3c4"}>{"span.jsx-a9535d7d5f32c3c4{color:red}"}</_JSXStyle>
|
|
20
|
+
|
|
21
|
+
</div>;
|
|
22
|
+
export default class {
|
|
23
|
+
render() {
|
|
24
|
+
return <div className={"jsx-b2b86d63f35d25ee"}>
|
|
25
|
+
|
|
26
|
+
<p className={"jsx-b2b86d63f35d25ee"}>test</p>
|
|
27
|
+
|
|
28
|
+
<_JSXStyle id={"b2b86d63f35d25ee"}>{"p.jsx-b2b86d63f35d25ee{color:red}"}</_JSXStyle>
|
|
29
|
+
|
|
30
|
+
</div>;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
export default (()=><div className={"jsx-94239b6d6b42c9b5"}>
|
|
3
|
+
|
|
4
|
+
<p className={"jsx-94239b6d6b42c9b5"}>woot</p>
|
|
5
|
+
|
|
6
|
+
<style dangerouslySetInnerHTML={{
|
|
7
|
+
__html: `body { margin: 0; }`
|
|
8
|
+
}}></style>
|
|
9
|
+
|
|
10
|
+
<_JSXStyle id={"94239b6d6b42c9b5"}>{"p.jsx-94239b6d6b42c9b5{color:red}"}</_JSXStyle>
|
|
11
|
+
|
|
12
|
+
</div>);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import css from 'hell';
|
|
2
|
+
const color = 'red';
|
|
3
|
+
const bar = css`
|
|
4
|
+
div {
|
|
5
|
+
font-size: 3em;
|
|
6
|
+
}
|
|
7
|
+
`;
|
|
8
|
+
export const uh = bar;
|
|
9
|
+
export const foo = css`div { color: ${color}}`;
|
|
10
|
+
export default css`
|
|
11
|
+
div {
|
|
12
|
+
font-size: 3em;
|
|
13
|
+
}
|
|
14
|
+
p {
|
|
15
|
+
color: ${color};
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
const Title = styled.h1`
|
|
19
|
+
color: red;
|
|
20
|
+
font-size: 50px;
|
|
21
|
+
`;
|
|
22
|
+
const AnotherTitle = Title.extend`color: blue;`;
|
|
23
|
+
export const Component = ()=><AnotherTitle>My page</AnotherTitle>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
import Link from "next/link";
|
|
3
|
+
export default function IndexPage() {
|
|
4
|
+
return <div className={"jsx-9a4b3442d519aae9"}>
|
|
5
|
+
|
|
6
|
+
Hello World.{" "}
|
|
7
|
+
|
|
8
|
+
<Link href="/about">
|
|
9
|
+
|
|
10
|
+
<a className={"jsx-9a4b3442d519aae9"}>Abound</a>
|
|
11
|
+
|
|
12
|
+
</Link>
|
|
13
|
+
|
|
14
|
+
<_JSXStyle id={"9a4b3442d519aae9"}>{`a.jsx-9a4b3442d519aae9{color:${"#abcdef"}12}`}</_JSXStyle>
|
|
15
|
+
|
|
16
|
+
</div>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
export default (()=><div className={"jsx-c7c3a8e231c9215a"}>
|
|
3
|
+
|
|
4
|
+
<p className={"jsx-c7c3a8e231c9215a"}>test</p>
|
|
5
|
+
|
|
6
|
+
<_JSXStyle id={"c7c3a8e231c9215a"}>{".container.jsx-c7c3a8e231c9215a>*{color:red}"}</_JSXStyle>
|
|
7
|
+
|
|
8
|
+
</div>);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
import colors, { size } from './constants';
|
|
3
|
+
const color = 'red';
|
|
4
|
+
const bar = new String("div.jsx-aaed0341accea8f{font-size:3em}");
|
|
5
|
+
bar.__hash = "aaed0341accea8f";
|
|
6
|
+
const baz = new String("div{font-size:3em}");
|
|
7
|
+
baz.__hash = "aaed0341accea8f";
|
|
8
|
+
const a = new String(`div{font-size:${size}em}`);
|
|
9
|
+
a.__hash = "b4e02b3e84cc50c";
|
|
10
|
+
export const uh = bar;
|
|
11
|
+
export const foo = new String(`div.jsx-1a001e3709d54ba4{color:${color}}`);
|
|
12
|
+
foo.__hash = "1a001e3709d54ba4";
|
|
13
|
+
({
|
|
14
|
+
styles: <_JSXStyle id={"7a7480dd17e82e07"}>{`div.jsx-7a7480dd17e82e07{color:${colors.green.light}}a.jsx-7a7480dd17e82e07{color:red}`}</_JSXStyle>,
|
|
15
|
+
className: "jsx-7a7480dd17e82e07"
|
|
16
|
+
});
|
|
17
|
+
const b = {
|
|
18
|
+
styles: <_JSXStyle id={"7a7480dd17e82e07"}>{`div.jsx-7a7480dd17e82e07{color:${colors.green.light}}a.jsx-7a7480dd17e82e07{color:red}`}</_JSXStyle>,
|
|
19
|
+
className: "jsx-7a7480dd17e82e07"
|
|
20
|
+
};
|
|
21
|
+
const dynamic = (colors)=>{
|
|
22
|
+
const b = {
|
|
23
|
+
styles: <_JSXStyle id={"9f775f199a8dfb95"} dynamic={[
|
|
24
|
+
colors.green.light
|
|
25
|
+
]}>{`div.__jsx-style-dynamic-selector{color:${colors.green.light}}a.__jsx-style-dynamic-selector{color:red}`}</_JSXStyle>,
|
|
26
|
+
className: _JSXStyle.dynamic([
|
|
27
|
+
[
|
|
28
|
+
"9f775f199a8dfb95",
|
|
29
|
+
[
|
|
30
|
+
colors.green.light
|
|
31
|
+
]
|
|
32
|
+
]
|
|
33
|
+
])
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export default {
|
|
37
|
+
styles: <_JSXStyle id={"e14aa5a1efa47449"}>{`div.jsx-e14aa5a1efa47449{font-size:3em}p.jsx-e14aa5a1efa47449{color:${color}}`}</_JSXStyle>,
|
|
38
|
+
className: "jsx-e14aa5a1efa47449"
|
|
39
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// TODO
|
|
2
|
+
// import css from 'styled-jsx/css'
|
|
3
|
+
// const color = 'red'
|
|
4
|
+
// export const foo = css`div { color: ${color}}`
|
|
5
|
+
// const props = { color: 'red ' }
|
|
6
|
+
// export default css`
|
|
7
|
+
// div { font-size: 3em; color: ${props.color} }
|
|
8
|
+
// p { color: ${this.props.color};}
|
|
9
|
+
// `
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
export const Red = ({ Component = 'button' })=>{
|
|
3
|
+
return <Component className={_JSXStyle.dynamic([
|
|
4
|
+
[
|
|
5
|
+
"1a9f9e2fa701f7ec",
|
|
6
|
+
[
|
|
7
|
+
e1,
|
|
8
|
+
e2,
|
|
9
|
+
e3,
|
|
10
|
+
e4,
|
|
11
|
+
e5,
|
|
12
|
+
e6,
|
|
13
|
+
e7,
|
|
14
|
+
e8,
|
|
15
|
+
e9,
|
|
16
|
+
e10,
|
|
17
|
+
e11,
|
|
18
|
+
e12,
|
|
19
|
+
e13,
|
|
20
|
+
e14,
|
|
21
|
+
e15
|
|
22
|
+
]
|
|
23
|
+
]
|
|
24
|
+
])}>
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
{}
|
|
29
|
+
|
|
30
|
+
<_JSXStyle id={"1a9f9e2fa701f7ec"} dynamic={[
|
|
31
|
+
e1,
|
|
32
|
+
e2,
|
|
33
|
+
e3,
|
|
34
|
+
e4,
|
|
35
|
+
e5,
|
|
36
|
+
e6,
|
|
37
|
+
e7,
|
|
38
|
+
e8,
|
|
39
|
+
e9,
|
|
40
|
+
e10,
|
|
41
|
+
e11,
|
|
42
|
+
e12,
|
|
43
|
+
e13,
|
|
44
|
+
e14,
|
|
45
|
+
e15
|
|
46
|
+
]}>{`.button.__jsx-style-dynamic-selector{--button-1:${e1};--button-2:${e2};--button-3:${e3};--button-4:${e4};--button-5:${e5};--button-6:${e6};--button-7:${e7};--button-8:${e8};--button-9:${e9};--button-10:${e10};--button-11:${e11};--button-12:${e12};--button-13:${e13};--button-14:${e14};--button-15:${e15}}`}</_JSXStyle>
|
|
47
|
+
|
|
48
|
+
</Component>;
|
|
49
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
export default class {
|
|
3
|
+
render() {
|
|
4
|
+
return <div className={"jsx-1f6cef12199c3a8f"}>
|
|
5
|
+
|
|
6
|
+
<p className={"jsx-1f6cef12199c3a8f"}>test</p>
|
|
7
|
+
|
|
8
|
+
<_JSXStyle id={"1f6cef12199c3a8f"}>{'p.jsx-1f6cef12199c3a8f{content:"`"}'}</_JSXStyle>
|
|
9
|
+
|
|
10
|
+
</div>;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
export default function Home({ fontFamily }) {
|
|
3
|
+
return <div className={_JSXStyle.dynamic([
|
|
4
|
+
[
|
|
5
|
+
"3892513b52a23034",
|
|
6
|
+
[
|
|
7
|
+
fontFamily
|
|
8
|
+
]
|
|
9
|
+
]
|
|
10
|
+
])}>
|
|
11
|
+
|
|
12
|
+
<_JSXStyle id={"3892513b52a23034"} dynamic={[
|
|
13
|
+
fontFamily
|
|
14
|
+
]}>{`body{font-family:${fontFamily}}code:before,code:after{content:"\`"}`}</_JSXStyle>
|
|
15
|
+
|
|
16
|
+
</div>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
export default class {
|
|
3
|
+
render() {
|
|
4
|
+
return <div className={_JSXStyle.dynamic([
|
|
5
|
+
[
|
|
6
|
+
"fc144a5ba38f1ea7",
|
|
7
|
+
[
|
|
8
|
+
inputSize ? 'height: calc(2 * var(--a)) !important;' : ''
|
|
9
|
+
]
|
|
10
|
+
]
|
|
11
|
+
])}>
|
|
12
|
+
|
|
13
|
+
<p className={_JSXStyle.dynamic([
|
|
14
|
+
[
|
|
15
|
+
"fc144a5ba38f1ea7",
|
|
16
|
+
[
|
|
17
|
+
inputSize ? 'height: calc(2 * var(--a)) !important;' : ''
|
|
18
|
+
]
|
|
19
|
+
]
|
|
20
|
+
])}>test</p>
|
|
21
|
+
|
|
22
|
+
<_JSXStyle id={"fc144a5ba38f1ea7"} dynamic={[
|
|
23
|
+
inputSize ? 'height: calc(2 * var(--a)) !important;' : ''
|
|
24
|
+
]}>{`@media only screen{a.__jsx-style-dynamic-selector{${inputSize ? 'height: calc(2 * var(--a)) !important;' : ''}:0}}`}</_JSXStyle>
|
|
25
|
+
|
|
26
|
+
</div>;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
export default class {
|
|
3
|
+
render() {
|
|
4
|
+
return <div className={_JSXStyle.dynamic([
|
|
5
|
+
[
|
|
6
|
+
"2afd62ca79f8b081",
|
|
7
|
+
[
|
|
8
|
+
a[b],
|
|
9
|
+
-1 * (c || 0),
|
|
10
|
+
d
|
|
11
|
+
]
|
|
12
|
+
]
|
|
13
|
+
])}>
|
|
14
|
+
|
|
15
|
+
<p className={_JSXStyle.dynamic([
|
|
16
|
+
[
|
|
17
|
+
"2afd62ca79f8b081",
|
|
18
|
+
[
|
|
19
|
+
a[b],
|
|
20
|
+
-1 * (c || 0),
|
|
21
|
+
d
|
|
22
|
+
]
|
|
23
|
+
]
|
|
24
|
+
])}>test</p>
|
|
25
|
+
|
|
26
|
+
<_JSXStyle id={"2afd62ca79f8b081"} dynamic={[
|
|
27
|
+
a[b],
|
|
28
|
+
-1 * (c || 0),
|
|
29
|
+
d
|
|
30
|
+
]}>{`.a:hover .b.__jsx-style-dynamic-selector{a:${a[b]}px!important;b:translate3d(0,${-1 * (c || 0)}px,-${d}px)scale(1)!important}`}</_JSXStyle>
|
|
31
|
+
|
|
32
|
+
</div>;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
export default class {
|
|
3
|
+
render() {
|
|
4
|
+
return <div className={_JSXStyle.dynamic([
|
|
5
|
+
[
|
|
6
|
+
"e37942245bf0eb35",
|
|
7
|
+
[
|
|
8
|
+
a
|
|
9
|
+
]
|
|
10
|
+
]
|
|
11
|
+
])}>
|
|
12
|
+
|
|
13
|
+
<p className={_JSXStyle.dynamic([
|
|
14
|
+
[
|
|
15
|
+
"e37942245bf0eb35",
|
|
16
|
+
[
|
|
17
|
+
a
|
|
18
|
+
]
|
|
19
|
+
]
|
|
20
|
+
])}>test</p>
|
|
21
|
+
|
|
22
|
+
<_JSXStyle id={"e37942245bf0eb35"} dynamic={[
|
|
23
|
+
a
|
|
24
|
+
]}>{`@media only screen{a.__jsx-style-dynamic-selector{color:${a}}}`}</_JSXStyle>
|
|
25
|
+
|
|
26
|
+
</div>;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
export default class {
|
|
3
|
+
render() {
|
|
4
|
+
return <div className={_JSXStyle.dynamic([
|
|
5
|
+
[
|
|
6
|
+
"b9b97de593829e6",
|
|
7
|
+
[
|
|
8
|
+
a || 'var(--c)',
|
|
9
|
+
b || 'inherit'
|
|
10
|
+
]
|
|
11
|
+
]
|
|
12
|
+
])}>
|
|
13
|
+
|
|
14
|
+
<p className={_JSXStyle.dynamic([
|
|
15
|
+
[
|
|
16
|
+
"b9b97de593829e6",
|
|
17
|
+
[
|
|
18
|
+
a || 'var(--c)',
|
|
19
|
+
b || 'inherit'
|
|
20
|
+
]
|
|
21
|
+
]
|
|
22
|
+
])}>test</p>
|
|
23
|
+
|
|
24
|
+
<_JSXStyle id={"b9b97de593829e6"} dynamic={[
|
|
25
|
+
a || 'var(--c)',
|
|
26
|
+
b || 'inherit'
|
|
27
|
+
]}>{`.a:hover .b.__jsx-style-dynamic-selector{display:inline-block;padding:0 ${a || 'var(--c)'};color:${b || 'inherit'}}`}</_JSXStyle>
|
|
28
|
+
|
|
29
|
+
</div>;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
export default class {
|
|
3
|
+
render() {
|
|
4
|
+
return <div className={_JSXStyle.dynamic([
|
|
5
|
+
[
|
|
6
|
+
"23692842dc904882",
|
|
7
|
+
[
|
|
8
|
+
a ? '100%' : '200px',
|
|
9
|
+
b ? '0' : '8px 20px'
|
|
10
|
+
]
|
|
11
|
+
]
|
|
12
|
+
])}>
|
|
13
|
+
|
|
14
|
+
<p className={_JSXStyle.dynamic([
|
|
15
|
+
[
|
|
16
|
+
"23692842dc904882",
|
|
17
|
+
[
|
|
18
|
+
a ? '100%' : '200px',
|
|
19
|
+
b ? '0' : '8px 20px'
|
|
20
|
+
]
|
|
21
|
+
]
|
|
22
|
+
])}>test</p>
|
|
23
|
+
|
|
24
|
+
<_JSXStyle id={"23692842dc904882"} dynamic={[
|
|
25
|
+
a ? '100%' : '200px',
|
|
26
|
+
b ? '0' : '8px 20px'
|
|
27
|
+
]}>{`.item.__jsx-style-dynamic-selector{max-width:${a ? '100%' : '200px'};padding:${b ? '0' : '8px 20px'}}`}</_JSXStyle>
|
|
28
|
+
|
|
29
|
+
</div>;
|
|
30
|
+
}
|
|
31
|
+
}
|