Sha256: c47640c84d674733aa6aebf22af03835d48900dff0dea3c367c2bfddf48da0b9

Contents?: true

Size: 919 Bytes

Versions: 245

Compression:

Stored size: 919 Bytes

Contents

@mixin media($query:$feature $value $columns, $total-columns: $grid-columns) {
  @if length($query) == 1 {
    @media screen and ($default-feature: nth($query, 1)) {
      $default-grid-columns: $grid-columns;
      $grid-columns: $total-columns;
      @content;
      $grid-columns: $default-grid-columns;
    }
  }

  @else {
    $loopTo: length($query);
    $mediaQuery: 'screen and ';
    $default-grid-columns: $grid-columns;
    $grid-columns: $total-columns;

    @if length($query) % 2 != 0 {
      $grid-columns: nth($query, $loopTo);
      $loopTo: $loopTo - 1;
    }

    $i: 1;
    @while $i <= $loopTo {
      $mediaQuery: $mediaQuery + '(' + nth($query, $i) + ': ' + nth($query, $i + 1) + ') ';

      @if ($i + 1) != $loopTo {
        $mediaQuery: $mediaQuery + 'and ';
      }

      $i: $i + 2;
    }

    @media #{$mediaQuery} {
      @content;
      $grid-columns: $default-grid-columns;
    }
  }
}

Version data entries

245 entries across 245 versions & 3 rubygems

Version Path
smock-0.1.268 app/assets/stylesheets/thirdparty/neat/grid/_media.scss
smock-0.1.267 app/assets/stylesheets/thirdparty/neat/grid/_media.scss
smock-0.1.266 app/assets/stylesheets/thirdparty/neat/grid/_media.scss
smock-0.1.265 app/assets/stylesheets/thirdparty/neat/grid/_media.scss
smock-0.1.264 app/assets/stylesheets/thirdparty/neat/grid/_media.scss
smock-0.1.263 app/assets/stylesheets/thirdparty/neat/grid/_media.scss
smock-0.1.262 app/assets/stylesheets/thirdparty/neat/grid/_media.scss
smock-0.1.261 app/assets/stylesheets/thirdparty/neat/grid/_media.scss
smock-0.1.260 app/assets/stylesheets/thirdparty/neat/grid/_media.scss
smock-0.1.259 app/assets/stylesheets/thirdparty/neat/grid/_media.scss
smock-0.1.258 app/assets/stylesheets/thirdparty/neat/grid/_media.scss
smock-0.1.256 app/assets/stylesheets/thirdparty/neat/grid/_media.scss
smock-0.1.255 app/assets/stylesheets/thirdparty/neat/grid/_media.scss
smock-0.1.254 app/assets/stylesheets/thirdparty/neat/grid/_media.scss
smock-0.1.253 app/assets/stylesheets/thirdparty/neat/grid/_media.scss
smock-0.1.252 app/assets/stylesheets/thirdparty/neat/grid/_media.scss
smock-0.1.251 app/assets/stylesheets/thirdparty/neat/grid/_media.scss
smock-0.1.250 app/assets/stylesheets/thirdparty/neat/grid/_media.scss
smock-0.1.249 app/assets/stylesheets/thirdparty/neat/grid/_media.scss
smock-0.1.247 app/assets/stylesheets/thirdparty/neat/grid/_media.scss