shawnbot/sast

Sass Interpolations are not correctly stringified

Open

#12 opened on Dec 2, 2019

 (1 comment) (0 reactions) (0 assignees)JavaScript (5 forks)github user discovery
bughelp wanted

Repository metrics

Stars
 (52 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

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.

Contributor guide