Sha256: dffee842da62a6ce5ccd76e8dfed36e2c60fad7a037265545454da0db22ff7e3

Contents?: true

Size: 1.67 KB

Versions: 38

Compression:

Stored size: 1.67 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

38 entries across 38 versions & 4 rubygems

Version Path
jekyll-theme-so-simple-3.1.0 _sass/so-simple/vendor/breakpoint/parsers/resolution/_resolution.scss
jekyll-theme-basically-basic-1.3.1 _sass/basically-basic/vendor/breakpoint/parsers/resolution/_resolution.scss
minimal-mistakes-jekyll-4.10.0 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
jekyll-theme-basically-basic-1.3.0 _sass/basically-basic/vendor/breakpoint/parsers/resolution/_resolution.scss
jekyll-theme-so-simple-3.0.1 _sass/so-simple/vendor/breakpoint/parsers/resolution/_resolution.scss
jekyll-theme-so-simple-3.0.0 _sass/so-simple/vendor/breakpoint/parsers/resolution/_resolution.scss
minimal-mistakes-jekyll-4.9.1 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
jekyll-theme-basically-basic-1.2.0 _sass/basically-basic/vendor/breakpoint/parsers/resolution/_resolution.scss
minimal-mistakes-jekyll-4.8.0 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
minimal-mistakes-jekyll-4.7.1 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
jekyll-theme-basically-basic-1.1.3 _sass/basically-basic/vendor/breakpoint/parsers/resolution/_resolution.scss
jekyll-theme-basically-basic-1.1.2 _sass/basically-basic/vendor/breakpoint/parsers/resolution/_resolution.scss
minimal-mistakes-jekyll-4.6.0 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
jekyll-theme-basically-basic-1.1.1 _sass/basically-basic/vendor/breakpoint/parsers/resolution/_resolution.scss
minimal-mistakes-jekyll-4.5.2 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
minimal-mistakes-jekyll-4.5.1 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
minimal-mistakes-jekyll-4.5.0 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
minimal-mistakes-jekyll-4.4.2 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
minimal-mistakes-jekyll-4.4.0 _sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss
sparrow-jekyll-theme-0.1.1 _sass/vendor/breakpoint/parsers/resolution/_resolution.scss