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

Fix multiple var on a single property #210

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions test/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ html {

:root {
--color: rgb(255, 0, 0);
--color-h: 0;
--color-s: 100%;
--color-l: 50%;
--color-hsl: hsl(var(--color-h), var(--color-s), var(--color-l));
--ref-color: var(--color);
--circular: var(--circular-2);
--circular-2: var(--circular);
Expand Down Expand Up @@ -37,6 +41,10 @@ html {
color: var(--ref-color);
}

.test--color_w_vars {
color: var(--color-hsl);
}

.test--circular_var {
color: var(--circular);
}
Expand Down
9 changes: 9 additions & 0 deletions test/basic.expect.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ html {

:root {
--color: rgb(255, 0, 0);
--color-h: 0;
--color-s: 100%;
--color-l: 50%;
--color-hsl: hsl(var(--color-h), var(--color-s), var(--color-l));
--ref-color: var(--color);
--circular: var(--circular-2);
--circular-2: var(--circular);
Expand Down Expand Up @@ -42,6 +46,11 @@ html {
color: var(--ref-color);
}

.test--color_w_vars {
color: hsl(0, 100%, 50%);
color: var(--color-hsl);
}

.test--circular_var {
color: var(--circular);
}
Expand Down
9 changes: 9 additions & 0 deletions test/basic.import-is-empty.expect.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ html {

:root {
--color: rgb(255, 0, 0);
--color-h: 0;
--color-s: 100%;
--color-l: 50%;
--color-hsl: hsl(var(--color-h), var(--color-s), var(--color-l));
--ref-color: var(--color);
--circular: var(--circular-2);
--circular-2: var(--circular);
Expand Down Expand Up @@ -42,6 +46,11 @@ html {
color: var(--ref-color);
}

.test--color_w_vars {
color: hsl(0, 100%, 50%);
color: var(--color-hsl);
}

.test--circular_var {
color: var(--circular);
}
Expand Down
9 changes: 9 additions & 0 deletions test/basic.import.expect.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ html {

:root {
--color: rgb(255, 0, 0);
--color-h: 0;
--color-s: 100%;
--color-l: 50%;
--color-hsl: hsl(var(--color-h), var(--color-s), var(--color-l));
--ref-color: var(--color);
--circular: var(--circular-2);
--circular-2: var(--circular);
Expand Down Expand Up @@ -42,6 +46,11 @@ html {
color: var(--ref-color);
}

.test--color_w_vars {
color: hsl(0, 100%, 50%);
color: var(--color-hsl);
}

.test--circular_var {
color: var(--circular);
}
Expand Down
4 changes: 4 additions & 0 deletions test/basic.preserve.expect.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
color: rgb(255, 0, 0);
}

.test--color_w_vars {
color: hsl(0, 100%, 50%);
}

.test--circular_var {
color: var(--circular);
}
Expand Down
4 changes: 4 additions & 0 deletions test/export-properties.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
:root {
--ref-color: var(--color);
--color: rgb(255, 0, 0);
--color-h: 0;
--color-s: 100%;
--color-l: 50%;
--color-hsl: hsl(var(--color-h), var(--color-s), var(--color-l));
--circular: var(--circular-2);
--circular-2: var(--circular);
--margin: 0 10px 20px 30px;
Expand Down
4 changes: 4 additions & 0 deletions test/export-properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ module.exports = {
customProperties: {
'--ref-color': 'var(--color)',
'--color': 'rgb(255, 0, 0)',
'--color-h': '0',
'--color-s': '100%',
'--color-l': '50%',
'--color-hsl': 'hsl(var(--color-h), var(--color-s), var(--color-l))',
'--circular': 'var(--circular-2)',
'--circular-2': 'var(--circular)',
'--margin': '0 10px 20px 30px'
Expand Down
4 changes: 4 additions & 0 deletions test/export-properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"custom-properties": {
"--ref-color": "var(--color)",
"--color": "rgb(255, 0, 0)",
"--color-h": "0",
"--color-s": "100%",
"--color-l": "50%",
"--color-hsl": "hsl(var(--color-h), var(--color-s), var(--color-l))",
"--circular": "var(--circular-2)",
"--circular-2": "var(--circular)",
"--margin": "0 10px 20px 30px"
Expand Down
4 changes: 4 additions & 0 deletions test/export-properties.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
export const customProperties = {
'--ref-color': 'var(--color)',
'--color': 'rgb(255, 0, 0)',
'--color-h': '0',
'--color-s': '100%',
'--color-l': '50%',
'--color-hsl': 'hsl(var(--color-h), var(--color-s), var(--color-l))',
'--circular': 'var(--circular-2)',
'--circular-2': 'var(--circular)',
'--margin': '0 10px 20px 30px'
Expand Down