postcss-advanced-variables icon indicating copy to clipboard operation
postcss-advanced-variables copied to clipboard

Correctly handle empty @content blocks in a @mixin

Open jesstelford opened this issue 1 year ago • 0 comments

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') */

jesstelford avatar Jan 11 '24 07:01 jesstelford