shawnbot / sast

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

Indented Mixin Syntax not properly supported #13

Open ManuelSch opened 4 years ago

ManuelSch commented 4 years ago

The Indented Mixin Syntax (https://sass-lang.com/documentation/at-rules/mixin#indented-mixin-syntax) is not supported and leads to wrong output.

Mixin definition:

const tree = sast.parse('=my_mixin\n  margin: 0', { syntax: 'sass' });
console.log(tree);
console.log(sast.stringify(tree, { syntax: 'scss' }));

// should output: @mixin my_mixin { margin: 0; }
// current output: =my_mixin { margin: 0; }

Mixin include:

const tree = sast.parse('+my_mixin()', { syntax: 'sass' });
console.log(tree)
console.log(sast.stringify(tree, { syntax: 'scss' }))

// should output: @include my_mixin()
// current output: +my_mixin()
shawnbot commented 4 years ago

Thanks for reporting this!