Skip to content
This repository was archived by the owner on Feb 9, 2023. It is now read-only.

Commit 2d60dbd

Browse files
committed
Add testcase
1 parent a2a6e11 commit 2d60dbd

File tree

3 files changed

+158
-0
lines changed

3 files changed

+158
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import styled, { css } from 'styled-components';
2+
const Message = styled.p`
3+
padding: 10px;
4+
${(props) => `
5+
color: #b02d00;
6+
`}
7+
${(props2) => `
8+
border-color: red;
9+
`}
10+
`;
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
{
2+
"raws": {},
3+
"type": "root",
4+
"nodes": [
5+
{
6+
"raws": {
7+
"semicolon": false,
8+
"after": "\n"
9+
},
10+
"type": "root",
11+
"nodes": [
12+
{
13+
"raws": {
14+
"before": "\n\t",
15+
"between": ": "
16+
},
17+
"type": "decl",
18+
"source": {
19+
"start": {
20+
"line": 3,
21+
"column": 2
22+
},
23+
"input": {
24+
"file": "styled-components-nesting-template-literal.js",
25+
"quasis": [
26+
{
27+
"start": 74,
28+
"end": 92
29+
},
30+
{
31+
"start": 128,
32+
"end": 130
33+
},
34+
{
35+
"start": 170,
36+
"end": 171
37+
}
38+
]
39+
},
40+
"end": {
41+
"line": 3,
42+
"column": 15
43+
}
44+
},
45+
"prop": "padding",
46+
"value": "10px"
47+
},
48+
{
49+
"raws": {
50+
"before": "\n\t"
51+
},
52+
"text": "${(props) => `\n\t\tcolor: #b02d00;\n\t`}",
53+
"type": "literal",
54+
"source": {
55+
"start": {
56+
"line": 4,
57+
"column": 2
58+
},
59+
"input": {
60+
"file": "styled-components-nesting-template-literal.js",
61+
"quasis": [
62+
{
63+
"start": 74,
64+
"end": 92
65+
},
66+
{
67+
"start": 128,
68+
"end": 130
69+
},
70+
{
71+
"start": 170,
72+
"end": 171
73+
}
74+
]
75+
}
76+
}
77+
},
78+
{
79+
"raws": {
80+
"before": "\n\t"
81+
},
82+
"text": "${(props2) => `\n\t\tborder-color: red;\n\t`}",
83+
"type": "literal",
84+
"source": {
85+
"start": {
86+
"line": 7,
87+
"column": 2
88+
},
89+
"input": {
90+
"file": "styled-components-nesting-template-literal.js",
91+
"quasis": [
92+
{
93+
"start": 74,
94+
"end": 92
95+
},
96+
{
97+
"start": 128,
98+
"end": 130
99+
},
100+
{
101+
"start": 170,
102+
"end": 171
103+
}
104+
]
105+
}
106+
}
107+
}
108+
],
109+
"source": {
110+
"input": {
111+
"file": "styled-components-nesting-template-literal.js",
112+
"quasis": [
113+
{
114+
"start": 74,
115+
"end": 92
116+
},
117+
{
118+
"start": 128,
119+
"end": 130
120+
},
121+
{
122+
"start": 170,
123+
"end": 171
124+
}
125+
]
126+
},
127+
"start": {
128+
"line": 2,
129+
"column": 26
130+
},
131+
"inline": false,
132+
"lang": "template-literal",
133+
"syntax": {}
134+
}
135+
}
136+
],
137+
"source": {
138+
"input": {
139+
"file": "styled-components-nesting-template-literal.js"
140+
},
141+
"start": {
142+
"line": 1,
143+
"column": 1
144+
},
145+
"lang": "jsx"
146+
}
147+
}

test/supports.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ describe("should support for each CSS in JS package", () => {
4141
"styled-components-nesting2.js",
4242
"styled-components-nesting3.js",
4343
"styled-components-nesting-nesting.js",
44+
"styled-components-nesting-template-literal.js",
4445
"styled-components.js",
4546
"styled-opts.mjs",
4647
"styled-props.jsx",

0 commit comments

Comments
 (0)