Skip to content

Commit 12a8d33

Browse files
authored
PostCSS Custom Properties – add tests for variables with url() (#135)
1 parent d2c2588 commit 12a8d33

11 files changed

+36
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ html {
1616
--shadow: 0 6px 14px 0 color(var(--shadow-color) a(.15));
1717
--font-family: "Open Sans", sans-serif;
1818
color: var(--color);
19+
--url: url("/my/path");
1920
}
2021

2122
:root,
@@ -99,3 +100,7 @@ html {
99100
.test--combined-selector {
100101
color: var(--theme-color);
101102
}
103+
104+
.test--variable-with-url {
105+
background: var(--url);
106+
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ html {
1717
--font-family: "Open Sans", sans-serif;
1818
color: rgb(255, 0, 0);
1919
color: var(--color);
20+
--url: url("/my/path");
2021
}
2122

2223
:root,
@@ -114,3 +115,8 @@ html {
114115
color: #053;
115116
color: var(--theme-color);
116117
}
118+
119+
.test--variable-with-url {
120+
background: url("/my/path");
121+
background: var(--url);
122+
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ html {
1717
--font-family: "Open Sans", sans-serif;
1818
color: rgb(255, 0, 0);
1919
color: var(--color);
20+
--url: url("/my/path");
2021
}
2122

2223
:root,
@@ -114,3 +115,8 @@ html {
114115
color: #053;
115116
color: var(--theme-color);
116117
}
118+
119+
.test--variable-with-url {
120+
background: url("/my/path");
121+
background: var(--url);
122+
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,7 @@
7575
.test--combined-selector {
7676
color: #053;
7777
}
78+
79+
.test--variable-with-url {
80+
background: url("/my/path");
81+
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ html {
1717
--font-family: "Open Sans", sans-serif;
1818
color: rgb(255, 0, 0);
1919
color: var(--color);
20+
--url: url("/my/path");
2021
}
2122

2223
:root,
@@ -115,3 +116,8 @@ html {
115116
color: #053;
116117
color: var(--theme-color);
117118
}
119+
120+
.test--variable-with-url {
121+
background: url("/my/path");
122+
background: var(--url);
123+
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,7 @@
7575
.test--combined-selector {
7676
color: #053;
7777
}
78+
79+
.test--variable-with-url {
80+
background: url("/my/path");
81+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
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");
1415
--theme-color: #053;
1516
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ 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")',
1516
'--theme-color': '#053'
1617
}
1718
};

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
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\")",
1516
"--theme-color": "#053"
1617
}
1718
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ 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")',
1415
'--theme-color': '#053'
1516
};

0 commit comments

Comments
 (0)