postcss-advanced-variables
postcss-advanced-variables copied to clipboard
Correctly handle empty @content blocks in a @mixin
Including a mixin that uses a @content
block without a block ({ }
) after the mixin name causes an error:
TypeError: Cannot read properties of undefined (reading 'type')
Example:
@mixin test {
display: block;
@content;
}
@include test {
width: 20px;
}
/* PASS:
display: block;
width: 20px;
*/
@include test { }
/* PASS:
display: block;
*/
@include test;
/* ERROR with: TypeError: Cannot read properties of undefined (reading 'type') */