postcss / postcss-simple-vars

PostCSS plugin for Sass-like variables
MIT License
415 stars 36 forks source link

Variable interpolation - does not allow interpolating multiple variables. #34

Closed ghost closed 8 years ago

ghost commented 8 years ago
$var1: value_of_var1;
$var2: value_of_var2;

$(var1)text // value_of_var1text
$(var1)$(var2) // Undefined variable $var1value_of_var2

According to this unittest this seems to be the wanted behaviour, but should it really be? https://github.com/postcss/postcss-simple-vars/blob/master/test/test.js#L29

It seem that the variable interpolation should allow for concatenating multiple variables.

An obvious example is:

width: $(width)$(unit);
ai commented 8 years ago

Can’t reproduce:

$var1: value_of_var1;
$var2: value_of_var2;

width: $(var1)text;
width: $(var1)$(var2);

Output:

width: value_of_var1text;
width: value_of_var1value_of_var2;