sparkbox / splinter

🐭 Parse and split SCSS files based on functions and mixins.
2 stars 0 forks source link

fix if a mixin/func was nested in @media #10

Closed asimpson closed 7 years ago

asimpson commented 7 years ago

@robtarr :eyes: on this please? Basically I moved the walkAtRules "up" a level because the un-nesting plugin unwraps media rules so that the SCSS looks like:

@media (min-width: 40em) {
  @include brand(foo) {
    div span span p {
      color: red;
    }
  }
}

walkRules wasn't cutting it, since @ is an atrule, not a normal rule.

I also added this check into the regular brand function parsing.

robtarr commented 7 years ago

crash-test-dummies