shawnbot / sast

Parse CSS, Sass, SCSS, and Less into a unist syntax tree
The Unlicense
49 stars 5 forks source link

Sass Interpolations are not correctly stringified #12

Open ManuelSch opened 4 years ago

ManuelSch commented 4 years ago

Sass interpolations (https://sass-lang.com/documentation/interpolation) are parsed correctly, but stringify() removes them, resulting in incorrect code.

Steps to reproduce:

const tree = sast.parse('width: calc(100% - #{2 * $spacer})', { syntax: 'sass' });
console.log(sast.stringify(tree));

// should output: width: calc(100% - #{2 * $spacer})
// current output: width: calc(100% - 2 * $spacer)

This happens for both sass and scss.

shawnbot commented 4 years ago

Thanks for the report!