shawnbot/sast

Indented Mixin Syntax not properly supported

Open

#13 opened on Dec 2, 2019

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

Repository metrics

Stars
 (52 stars)
PR merge metrics
 (PR metrics pending)

Description

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()

Contributor guide