Sha256: 4f02b5fe5bb797b1aa8040433c76ed7b7e9a496296ebdb99d387485a7b95e25d

Contents?: true

Size: 1.61 KB

Versions: 246

Compression:

Stored size: 1.61 KB

Contents

@function breakpoint-make-resolutions($resolution) {
  $length: length($resolution);

  $output: ();

  @if $length == 2 {
    $feature: '';
    $value: '';

    // Find which is number
    @if type-of(nth($resolution, 1)) == 'number' {
      $value: nth($resolution, 1);
    }
    @else {
      $value: nth($resolution, 2);
    }

    // Determine min/max/standard
    @if index($resolution, 'min-resolution') {
      $feature: 'min-';
    }
    @else if index($resolution, 'max-resolution') {
      $feature: 'max-';
    }

    $standard: '(#{$feature}resolution: #{$value})';

    // If we're not dealing with dppx,
    @if unit($value) != 'dppx' {
      $base: 96dpi;
      @if unit($value) == 'dpcm' {
        $base: 243.84dpcm;
      }
      // Write out feature tests
      $webkit: '';
      $moz: '';
      $webkit: '(-webkit-#{$feature}device-pixel-ratio: #{$value / $base})';
      $moz: '(#{$feature}-moz-device-pixel-ratio: #{$value / $base})';
      // Append to output
      $output: append($output, $standard, space);
      $output: append($output, $webkit, space);
      $output: append($output, $moz, space);
    }
    @else {
      $webkit: '';
      $moz: '';
      $webkit: '(-webkit-#{$feature}device-pixel-ratio: #{$value / 1dppx})';
      $moz: '(#{$feature}-moz-device-pixel-ratio: #{$value / 1dppx})';
      $fallback: '(#{$feature}resolution: #{$value / 1dppx * 96dpi})';
      // Append to output
      $output: append($output, $standard, space);
      $output: append($output, $webkit, space);
      $output: append($output, $moz, space);
      $output: append($output, $fallback, space);
    }

  }

  @return $output;
}

Version data entries

246 entries across 184 versions & 12 rubygems

Version Path
dendron-jekyll-0.3.6 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
dendron-jekyll-0.3.5 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
dendron-jekyll-0.3.4 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
minimal-mistakes-jekyll-4.20.2 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
dendron-jekyll-0.3.3 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
dendron-jekyll-0.3.2 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
minimal-mistakes-jekyll-4.20.1 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
minimal-mistakes-jekyll-4.20.0 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
minimal-mistakes-jekyll-4.19.3 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
minimal-mistakes-jekyll-4.19.2 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
minimal-mistakes-jekyll-4.19.1 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
minimal-mistakes-jekyll-4.19.0 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
minimal-mistakes-jekyll-4.18.1 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
minimal-mistakes-jekyll-4.18.0 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
jekyll-theme-so-simple-3.2.0 _sass/so-simple/vendor/breakpoint/parsers/resolution/_resolution.scss
minimal-mistakes-jekyll-4.17.2 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
minimal-mistakes-jekyll-4.17.1 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
minimal-mistakes-jekyll-4.17.0 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
jekyll-theme-so-simple-3.1.3 _sass/so-simple/vendor/breakpoint/parsers/resolution/_resolution.scss
jekyll-theme-basically-basic-1.4.4 _sass/basically-basic/vendor/breakpoint/parsers/resolution/_resolution.scss