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

valid @each with & not working #770

Closed
alansouzati opened this issue Jun 29, 2016 · 4 comments
Closed

valid @each with & not working #770

alansouzati opened this issue Jun 29, 2016 · 4 comments

Comments

@alansouzati
Copy link
Contributor

Using 1.8.2, happens both in cli and from IDE.

This block is a valid one and I get:

Please check validity of the block starting from line #91 Fatal

@each $status, $color in $brand-status-colors {
    &-#{$status} {
      .#{$grommet-namespace}status-icon__base {
        fill: $color;
      }
    }
}

If I remove the "-" it works normally:

@each $status, $color in $brand-status-colors {
    &#{$status} {
      .#{$grommet-namespace}status-icon__base {
        fill: $color;
      }
    }
}

Any pointers?

@DanPurdy
Copy link
Member

It's an issue with the AST gonzales-pe I believe this PR will fix the issue for you tonyganch/gonzales-pe#179 once it's merged and released.

@alansouzati
Copy link
Contributor Author

Thanks for the follow up. For now I'm using the following work around, hope it helps folks facing similar issue:

@each $status, $color in $brand-status-colors {
  .#{$grommet-namespace}status-icon-#{$status} {
    .#{$grommet-namespace}status-icon__base {
      fill: $color;
    }
  }
}

Basically, I've moved the selector to be outside of the nested & scenario.

@DanPurdy
Copy link
Member

@alansouzati this parses without error in sass-lint 1.9.0

@alansouzati
Copy link
Contributor Author

thanks for the heads up @DanPurdy 👍

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

2 participants