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

Preserve spaces in multi-part values. #203

Merged
merged 1 commit into from
Jan 7, 2020
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
2 changes: 2 additions & 0 deletions .tape.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = {
'--color': 'rgb(255, 0, 0)',
'--color-2': 'yellow',
'--ref-color': 'var(--color)',
'--margin': '0 10px 20px 30px',
'--z-index': 10
}
}
Expand All @@ -30,6 +31,7 @@ module.exports = {
'--color': 'rgb(255, 0, 0)',
'--color-2': 'yellow',
'--ref-color': 'var(--color)',
'--margin': '0 10px 20px 30px',
'--z-index': 10
}
};
Expand Down
5 changes: 4 additions & 1 deletion src/lib/write-custom-properties-to-exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ export default function writeCustomPropertiesToExports(customProperties, destina

const defaultCustomPropertiesToJSON = customProperties => {
return Object.keys(customProperties).reduce((customPropertiesJSON, key) => {
customPropertiesJSON[key] = String(customProperties[key]);
const valueNodes = customProperties[key];
customPropertiesJSON[key] = valueNodes.map((propertyObject) => {
return propertyObject.toString();
}).join(' ');

return customPropertiesJSON;
}, {});
Expand Down
1 change: 1 addition & 0 deletions test/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ html {
--ref-color: var(--color);
--circular: var(--circular-2);
--circular-2: var(--circular);
--margin: 0 10px 20px 30px;
color: var(--color);
}

Expand Down
1 change: 1 addition & 0 deletions test/basic.expect.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ html {
--ref-color: var(--color);
--circular: var(--circular-2);
--circular-2: var(--circular);
--margin: 0 10px 20px 30px;
color: rgb(255, 0, 0);
color: var(--color);
}
Expand Down
1 change: 1 addition & 0 deletions test/basic.import-is-empty.expect.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ html {
--ref-color: var(--color);
--circular: var(--circular-2);
--circular-2: var(--circular);
--margin: 0 10px 20px 30px;
color: rgb(255, 0, 0);
color: var(--color);
}
Expand Down
1 change: 1 addition & 0 deletions test/basic.import.expect.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ html {
--ref-color: var(--color);
--circular: var(--circular-2);
--circular-2: var(--circular);
--margin: 0 10px 20px 30px;
color: rgb(255, 0, 0);
color: var(--color);
}
Expand Down
1 change: 1 addition & 0 deletions test/export-properties.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
--color: rgb(255, 0, 0);
--circular: var(--circular-2);
--circular-2: var(--circular);
--margin: 0 10px 20px 30px;
}
3 changes: 2 additions & 1 deletion test/export-properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module.exports = {
'--ref-color': 'var(--color)',
'--color': 'rgb(255, 0, 0)',
'--circular': 'var(--circular-2)',
'--circular-2': 'var(--circular)'
'--circular-2': 'var(--circular)',
'--margin': '0 10px 20px 30px'
}
};
3 changes: 2 additions & 1 deletion test/export-properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"--ref-color": "var(--color)",
"--color": "rgb(255, 0, 0)",
"--circular": "var(--circular-2)",
"--circular-2": "var(--circular)"
"--circular-2": "var(--circular)",
"--margin": "0 10px 20px 30px"
}
}
3 changes: 2 additions & 1 deletion test/export-properties.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ export const customProperties = {
'--ref-color': 'var(--color)',
'--color': 'rgb(255, 0, 0)',
'--circular': 'var(--circular-2)',
'--circular-2': 'var(--circular)'
'--circular-2': 'var(--circular)',
'--margin': '0 10px 20px 30px'
};