// Modernizr mixin to create html.modernizr selector

@mixin modernizr($feature) {
    html.kwfUp-#{$feature} & {
        @content;
    }
}
@mixin modernizr-no($feature, $no: true) {
    html.kwfUp-no-#{$feature} & {
        @content;
    }
}

// Modernizr mixin to create html.modernizr selector

@mixin _modernizr($htmlClass) {
    $selectors: selector_parse(&);
    $newSelectors: ();
    @each $selector in $selectors {
      $newSelector: ();
      $replacedHtml: false;
      @each $part in $selector {
        @if str-index($part, "html")==1{
          $part: "#{$part}.#{$htmlClass}";
          $replacedHtml: true;
        }
        $newSelector: append($newSelector, $part);
      }
      @if not($replacedHtml) {
        $newSelector: join(("html.#{$htmlClass}"), $newSelector);
      }
      $newSelectors: append($newSelectors, $newSelector);
    }
    @at-root {
      #{$newSelectors} {
        @content;
      }
    }
}


@mixin modernizr($feature) {
    @include _modernizr("kwfUp-no-#{$feature}") {
        @content;
    }
}
@mixin modernizr-no($feature) {
    @include _modernizr("kwfUp-#{$feature}") {
        @content;
    }
}

Support modernizr mixin nested in html selector
Support modernizr mixin nested in html selector
