dlmanning / gulp-sass

SASS plugin for gulp
MIT License
1.57k stars 381 forks source link

@content with argument not working #784

Closed jdelauney closed 2 years ago

jdelauney commented 3 years ago

Hi, For example i have this following @mixins

@mixin generateBreakPoints {
  @for $i from 1 through length($mediaBreakPoints) {
    $bpv : nth($mediaBreakPoints, $i);    
    $bp  : nth($mediaBreakPointsPrefix, $i);
    @media (min-width: #{$bpv}) {
      @content($bp);
    }
  }
}

When i compile the scss with gulp-sass he return me this error

Error in plugin "sass" Message: mysass\src\mysass.scss Error: Invalid CSS after " @content": expected "}", was "($bp);" mysass\src\mysass.scss

  @content($bp);

------^

It will be good to add this compatibility issue

Best regards

cpiber commented 3 years ago

This is not a problem of gulp-sass but node-sass (which this package wraps). This is only implemented in sass (dart-sass), see https://sass-lang.com/documentation/at-rules/mixin#passing-arguments-to-content-blocks If you want to use this, consider switching to dart sass by setting sass.compiler = require('sass');

XhmikosR commented 2 years ago

@xzyfer same here, unrelated to gulp-sass :)