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

Commit

Permalink
fix multiple var on a single property (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuran authored Mar 7, 2020
1 parent b898eb2 commit a250907
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 0 deletions.
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 @@ -42,6 +46,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 @@ -47,6 +51,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 @@ -47,6 +51,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 @@ -47,6 +51,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

0 comments on commit a250907

Please sign in to comment.