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

no-mergeable-selectors incorrectly trying to merge two selectors in different mixins #339

Closed
bgriffith opened this issue Oct 22, 2015 · 7 comments
Assignees
Labels

Comments

@bgriffith
Copy link
Member

This rule incorrectly tries to merge two selectors within two different mixins.
SassLint: 1.3.1

@mixin foo {
    &:disabled {
        color: red;
    }
}

@mixin input-bar {
    &:disabled {
        cursor: blue;
    }
}
@bgriffith bgriffith added the bug label Oct 22, 2015
@bgriffith bgriffith changed the title no-mergeable-selectors issue no-mergeable-selectors incorrectly trying to merge two selectors in different mixins Oct 22, 2015
@DanPurdy
Copy link
Member

Yeah, i need to look at mixins as part of #307 anyway so I'll combine the effort then

@bgriffith
Copy link
Member Author

Ah yeah, I see they're related.

@brokentone
Copy link

Same issue here. Although a slightly different test case for me -- one inside a mixin.

    & a { 
      display: block;
    }   

    @include breakpoint($bp-760) {
      & a { 
        display: inline-block;
      }   
    }   

@DanPurdy
Copy link
Member

Yeah, I'm hoping to look at this soon, it's going to be a little bit of a refactor it looks like.

@Snugug Snugug added this to the 1.5.1 - Latest Gonzales milestone Feb 7, 2016
@DanPurdy DanPurdy self-assigned this Feb 15, 2016
@tonifisler
Copy link

Same issue here with media queries:

.spacing {
  margin: 16px 0;
  &.spacing-sm {margin: 8px 0;}
  @media only screen and (max-width: 767px) {
    margin: 8px 0;
    &.spacing-sm {margin: 5px 0;}
  }
}

.spacing-bottom {
  margin-bottom: 32px;
  &.spacing-sm {margin-bottom: 15px;}
  @media only screen and (max-width: 767px) {
    margin-bottom: 15px;
    &.spacing-sm {margin-bottom: 10px;} // sass-lint triggers here
    // and suggests merging with the rule in the media query of .spacing
  }
}

@DanPurdy
Copy link
Member

Don't worry, this is in progress and should be resolved in our 1.6 update which we're hoping to get to you soon.

@DanPurdy
Copy link
Member

@tonifisler @bgriffith @brokentone All of your examples are fixed in the rewrite of the mergeable selectors rule released with sass-lint 1.6.0!

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

No branches or pull requests

5 participants