sparkbox / splinter

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

account for doubly nested "brand" mixins #11

Closed asimpson closed 7 years ago

asimpson commented 7 years ago

Sometimes "brand" mixins will be nested, e.g.

$current-brand: foo;

@mixin brand($mixin-brand) {
  @if $current-brand == $mixin-brand {
    @content;
  }
}

@mixin brand-text () {
  @include brand(foo) {
    font-family: Arial;
  }
}

body {
  margin: 0;

  @include brand(foo) {
    @include brand-text();
  }
}

The goal here is to have the body when in brand foo have the brand-text output, e.g.

body {
  margin: 0;
}

and

body {
  font-family: Arial
}
asimpson commented 7 years ago

merging after discussion with @robtarr