Sha256: d4d5bafde0c98a359fe09f4eca53c4ba50eb3791740009af12454c97370a2def

Contents?: true

Size: 1.37 KB

Versions: 2

Compression:

Stored size: 1.37 KB

Contents

////////////////////////
// Enhance From
//
// - $feature: Modernizr feature (base CSS class name)
////////////////////////
@mixin enhance-with($features, $extend: null) {
  $extend: if($extend != null, $extend, toolkit-get('enhance with extend'));

  @if $extend {
    $uid: unique-id();
    @at-root %#{$uid} {
      @content;
    }
    @each $feature in $features {
      .#{$feature} & {
        @extend %#{$uid};
      }
    }
  }
  @else {
    @each $feature in $features {
      .#{$feature} & {
        @content;
      }
    }
  }
}

////////////////////////
// Degrade From
//
// - $feature: Modernizr feature (base CSS class name)
////////////////////////
@mixin degrade-from($features, $no-js: null, $extend: null) {
  $no-js: if($no-js != null, $no-js, toolkit-get('degrade from javascript'));
  $extend: if($extend != null, $extend, toolkit-get('degrade from extend'));

  @if $extend {
    $uid: unique-id();
    @at-root %#{$uid} {
      @content;
    }

    @each $feature in $features {
      .no-#{$feature} & {
        @extend %#{$uid};
      }
    }

    @if not index($features, 'js') and $no-js != true {
      .no-js & {
        @extend %#{$uid};
      }
    }
  }
  @else {
    @each $feature in $features {
      .no-#{$feature} & {
        @content;
      }
    }

    @if not index($features, 'js') and $no-js != true {
      .no-js & {
        @content;
      }
    }
  }
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
toolkit-2.0.0.alpha.10 stylesheets/toolkit/_pe.scss
toolkit-2.0.0.alpha.9 stylesheets/toolkit/_pe.scss