postcss / postcss-custom-properties

Use Custom Properties in CSS
https://postcss.github.io/postcss-custom-properties
MIT License
597 stars 77 forks source link

Preserve spaces in multi-part values. #203

Closed desandro closed 4 years ago

desandro commented 4 years ago

This commit fixes the bug with space separated values. Previously, 0 10px 20px 30px would be exported with commas: 0,10px,20px,30px. This commit preverses spaces, to export 0 10px 20px 30px as expected.


Hi! We use postcss-custom-properties a bunch here at @UrbanCompass ! Thank you for all your work on PostCSS!

I recently came across a bug using exportTo. Multi-part values like 0 10px 20px 30px would be exported with commas instead of spaces: 0,10px,20px,30px. Exported values would look even more wild if there were commas already. For example,

// original
border-color, background, box-shadow, color
// exported
border-color,,,background,,,box-shadow,,,color

This PR resolves that. Tests updated as well 😸