Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mixin parsing error #184

Closed
davegreenwp opened this issue Sep 18, 2015 · 14 comments
Closed

Mixin parsing error #184

davegreenwp opened this issue Sep 18, 2015 · 14 comments

Comments

@davegreenwp
Copy link

I've just started using sass-lint via grunt-sass-lint and I'm getting a parsing error due to this mixin that I have:

/// Input placeholder styling
/// @param {List} $styles - Styles
/// @requires $kp-ph--prefixes
/// @group forms
@mixin kp-placeholder-styles($styles) {
  @each $pseudo in $kp-ph--prefixes {
    @at-root &#{$pseudo} {

      @each $key, $value in $styles {
        #{$key}: #{$value};
      }
    }

    @at-root &:focus#{$pseudo} {
      color: transparent;
    }
  }
}

Producing this error:
screen shot 2015-09-18 at 17 40 30

I've quickly copied the mixin and variables it depends on into Sassmeister (using Libsass 3.2.5 option) and it's working perfectly. I know this code is producing the correct results as I'm using it in a number of projects.

I was wondering whether this could be related to #44 but felt it best to post a new issue in case.

@davegreenwp
Copy link
Author

After a little testing it seems that it doesn't like more than one interpolated string per line?

EDIT: I commented out the offending code posted above to see what the next error would be, and it's failed when parsing a Bootstrap include which has several interpolated strings on the same line as follows:

  src: url(if($bootstrap-sass-asset-helper, twbs-font-path('#{$icon-font-path}#{$icon-font-name}.eot'), '#{$icon-font-path}#{$icon-font-name}.eot'));

@DanPurdy
Copy link
Member

Hmm, this looks like another issue with our AST, gonzales-pe.. I'm afraid we may be a little restricted in what we can do to fix this.. Will double check later on though...

@Undistraction
Copy link

FWIW this seems to fail on any interpolated value, quoted or otherwise, for example:

@mixin example {
    $name: 'width';
    #{$name}: 100%;
}

@DanPurdy
Copy link
Member

Yeah @Undistraction we are just waiting for the latest release of our AST to happen, it should fix the problems with interpolated strings. Looks like under a week now. Fingers crossed!

@Undistraction
Copy link

@DanPurdy That's great news. Thanks for the headsup.

@DanPurdy
Copy link
Member

See here for more info #222

@davegreenwp
Copy link
Author

@DanPurdy That's excellent news! Looking forward to kicking grunt-scss-lint out of bed once it drops! 👍

@aarr0n
Copy link

aarr0n commented Oct 1, 2015

👍

@DanPurdy
Copy link
Member

The original issue above is still causing a parse error as of the latest build of gonzales-pe (3.2.1) I've filed it as a fresh issue to hopefully see this fixed. You can follow the issue here

@davegreenwp
Copy link
Author

@DanPurdy Thanks for the update, much appreciated

@davegreenwp
Copy link
Author

@DanPurdy now that the issue is fixed in gonzales-3.2.x, are we just waiting for a sass-lint update which includes that update?

@DanPurdy
Copy link
Member

DanPurdy commented Mar 7, 2016

Yes, unfortunately gonzales-pe isn't installing on windows at moment due to some bash specific post install scripts so we're waiting for them to update or if we'll just fork it and roll our own version of it soon. Fingers crossed it wont be too long!

@DanPurdy
Copy link
Member

@davetgreen This is fixed in sass-lint 1.6.0

@davegreenwp
Copy link
Author

@DanPurdy Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants