Skip to content

Commit 9c09b71

Browse files
committed
postcss-custom-properties more url tests
1 parent 12a8d33 commit 9c09b71

11 files changed

+157
-13
lines changed

plugins/postcss-custom-properties/test/basic.css

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ html {
1515
--shadow-color: rgb(255,0,0);
1616
--shadow: 0 6px 14px 0 color(var(--shadow-color) a(.15));
1717
--font-family: "Open Sans", sans-serif;
18+
--url-1: url("/my/path");
19+
--url-2: url('/my/path');
20+
--url-3: url(/my/path);
21+
--url-4: url(data:image/png;bm90LWFuZC1pbWFnZQ==);
1822
color: var(--color);
19-
--url: url("/my/path");
2023
}
2124

2225
:root,
@@ -102,5 +105,23 @@ html {
102105
}
103106

104107
.test--variable-with-url {
105-
background: var(--url);
108+
order: 1;
109+
background: var(--url-1);
110+
}
111+
112+
.test--variable-with-url {
113+
order: 2;
114+
background: var(--url-2);
115+
}
116+
117+
118+
.test--variable-with-url {
119+
order: 3;
120+
background: var(--url-3);
121+
}
122+
123+
124+
.test--variable-with-url {
125+
order: 4;
126+
background: var(--url-4);
106127
}

plugins/postcss-custom-properties/test/basic.expect.css

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ html {
1515
--shadow-color: rgb(255,0,0);
1616
--shadow: 0 6px 14px 0 color(var(--shadow-color) a(.15));
1717
--font-family: "Open Sans", sans-serif;
18+
--url-1: url("/my/path");
19+
--url-2: url('/my/path');
20+
--url-3: url(/my/path);
21+
--url-4: url(data:image/png;bm90LWFuZC1pbWFnZQ==);
1822
color: rgb(255, 0, 0);
1923
color: var(--color);
20-
--url: url("/my/path");
2124
}
2225

2326
:root,
@@ -117,6 +120,27 @@ html {
117120
}
118121

119122
.test--variable-with-url {
123+
order: 1;
120124
background: url("/my/path");
121-
background: var(--url);
125+
background: var(--url-1);
126+
}
127+
128+
.test--variable-with-url {
129+
order: 2;
130+
background: url('/my/path');
131+
background: var(--url-2);
132+
}
133+
134+
135+
.test--variable-with-url {
136+
order: 3;
137+
background: url(/my/path);
138+
background: var(--url-3);
139+
}
140+
141+
142+
.test--variable-with-url {
143+
order: 4;
144+
background: url(data:image/png;bm90LWFuZC1pbWFnZQ==);
145+
background: var(--url-4);
122146
}

plugins/postcss-custom-properties/test/basic.import-is-empty.expect.css

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ html {
1515
--shadow-color: rgb(255,0,0);
1616
--shadow: 0 6px 14px 0 color(var(--shadow-color) a(.15));
1717
--font-family: "Open Sans", sans-serif;
18+
--url-1: url("/my/path");
19+
--url-2: url('/my/path');
20+
--url-3: url(/my/path);
21+
--url-4: url(data:image/png;bm90LWFuZC1pbWFnZQ==);
1822
color: rgb(255, 0, 0);
1923
color: var(--color);
20-
--url: url("/my/path");
2124
}
2225

2326
:root,
@@ -117,6 +120,27 @@ html {
117120
}
118121

119122
.test--variable-with-url {
123+
order: 1;
120124
background: url("/my/path");
121-
background: var(--url);
125+
background: var(--url-1);
126+
}
127+
128+
.test--variable-with-url {
129+
order: 2;
130+
background: url('/my/path');
131+
background: var(--url-2);
132+
}
133+
134+
135+
.test--variable-with-url {
136+
order: 3;
137+
background: url(/my/path);
138+
background: var(--url-3);
139+
}
140+
141+
142+
.test--variable-with-url {
143+
order: 4;
144+
background: url(data:image/png;bm90LWFuZC1pbWFnZQ==);
145+
background: var(--url-4);
122146
}

plugins/postcss-custom-properties/test/basic.import-override.expect.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,23 @@
7777
}
7878

7979
.test--variable-with-url {
80+
order: 1;
8081
background: url("/my/path");
8182
}
83+
84+
.test--variable-with-url {
85+
order: 2;
86+
background: url('/my/path');
87+
}
88+
89+
90+
.test--variable-with-url {
91+
order: 3;
92+
background: url(/my/path);
93+
}
94+
95+
96+
.test--variable-with-url {
97+
order: 4;
98+
background: url(data:image/png;bm90LWFuZC1pbWFnZQ==);
99+
}

plugins/postcss-custom-properties/test/basic.import.expect.css

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ html {
1515
--shadow-color: rgb(255,0,0);
1616
--shadow: 0 6px 14px 0 color(var(--shadow-color) a(.15));
1717
--font-family: "Open Sans", sans-serif;
18+
--url-1: url("/my/path");
19+
--url-2: url('/my/path');
20+
--url-3: url(/my/path);
21+
--url-4: url(data:image/png;bm90LWFuZC1pbWFnZQ==);
1822
color: rgb(255, 0, 0);
1923
color: var(--color);
20-
--url: url("/my/path");
2124
}
2225

2326
:root,
@@ -118,6 +121,27 @@ html {
118121
}
119122

120123
.test--variable-with-url {
124+
order: 1;
121125
background: url("/my/path");
122-
background: var(--url);
126+
background: var(--url-1);
127+
}
128+
129+
.test--variable-with-url {
130+
order: 2;
131+
background: url('/my/path');
132+
background: var(--url-2);
133+
}
134+
135+
136+
.test--variable-with-url {
137+
order: 3;
138+
background: url(/my/path);
139+
background: var(--url-3);
140+
}
141+
142+
143+
.test--variable-with-url {
144+
order: 4;
145+
background: url(data:image/png;bm90LWFuZC1pbWFnZQ==);
146+
background: var(--url-4);
123147
}

plugins/postcss-custom-properties/test/basic.preserve.expect.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,23 @@
7777
}
7878

7979
.test--variable-with-url {
80+
order: 1;
8081
background: url("/my/path");
8182
}
83+
84+
.test--variable-with-url {
85+
order: 2;
86+
background: url('/my/path');
87+
}
88+
89+
90+
.test--variable-with-url {
91+
order: 3;
92+
background: url(/my/path);
93+
}
94+
95+
96+
.test--variable-with-url {
97+
order: 4;
98+
background: url(data:image/png;bm90LWFuZC1pbWFnZQ==);
99+
}

plugins/postcss-custom-properties/test/export-properties.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
--shadow-color: rgb(255,0,0);
1212
--shadow: 0 6px 14px 0 color(var(--shadow-color) a(.15));
1313
--font-family: "Open Sans", sans-serif;
14-
--url: url("/my/path");
14+
--url-1: url("/my/path");
15+
--url-2: url('/my/path');
16+
--url-3: url(/my/path);
17+
--url-4: url(data:image/png;bm90LWFuZC1pbWFnZQ==);
1518
--theme-color: #053;
1619
}

plugins/postcss-custom-properties/test/export-properties.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ module.exports = {
1212
'--shadow-color': 'rgb(255,0,0)',
1313
'--shadow': '0 6px 14px 0 color(var(--shadow-color) a(.15))',
1414
'--font-family': '"Open Sans", sans-serif',
15-
'--url': 'url("/my/path")',
15+
'--url-1': 'url("/my/path")',
16+
'--url-2': 'url(\'/my/path\')',
17+
'--url-3': 'url(/my/path)',
18+
'--url-4': 'url(data:image/png;bm90LWFuZC1pbWFnZQ==)',
1619
'--theme-color': '#053'
1720
}
1821
};

plugins/postcss-custom-properties/test/export-properties.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
"--shadow-color": "rgb(255,0,0)",
1313
"--shadow": "0 6px 14px 0 color(var(--shadow-color) a(.15))",
1414
"--font-family": "\"Open Sans\", sans-serif",
15-
"--url": "url(\"/my/path\")",
15+
"--url-1": "url(\"/my/path\")",
16+
"--url-2": "url('/my/path')",
17+
"--url-3": "url(/my/path)",
18+
"--url-4": "url(data:image/png;bm90LWFuZC1pbWFnZQ==)",
1619
"--theme-color": "#053"
1720
}
1821
}

plugins/postcss-custom-properties/test/export-properties.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ export const customProperties = {
1111
'--shadow-color': 'rgb(255,0,0)',
1212
'--shadow': '0 6px 14px 0 color(var(--shadow-color) a(.15))',
1313
'--font-family': '"Open Sans", sans-serif',
14-
'--url': 'url("/my/path")',
14+
'--url-1': 'url("/my/path")',
15+
'--url-2': 'url(\'/my/path\')',
16+
'--url-3': 'url(/my/path)',
17+
'--url-4': 'url(data:image/png;bm90LWFuZC1pbWFnZQ==)',
1518
'--theme-color': '#053'
1619
};

plugins/postcss-custom-properties/test/export-properties.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,8 @@ $margin: 0 10px 20px 30px;
1010
$shadow-color: rgb(255,0,0);
1111
$shadow: 0 6px 14px 0 color(var(--shadow-color) a(.15));
1212
$font-family: "Open Sans", sans-serif;
13-
$url: url("/my/path");
13+
$url-1: url("/my/path");
14+
$url-2: url('/my/path');
15+
$url-3: url(/my/path);
16+
$url-4: url(data:image/png;bm90LWFuZC1pbWFnZQ==);
1417
$theme-color: #053;

0 commit comments

Comments
 (0)