Sha256: 2de144ac53057533475074dacb99d156555a44ae6a9fc54426c91068ba4713e8

Contents?: true

Size: 1.02 KB

Versions: 130

Compression:

Stored size: 1.02 KB

Contents

// Used for creating the source string for fonts using @font-face
// Reference: http://goo.gl/Ru1bKP

@function font-url-prefixer($asset-pipeline) {
  @if $asset-pipeline == true {
    @return font-url;
  } @else {
    @return url;
  }
}

@function font-source-declaration(
  $font-family,
  $file-path,
  $asset-pipeline,
  $file-formats,
  $font-url) {

  $src: ();

  $formats-map: (
    eot:   "#{$file-path}.eot?#iefix" format("embedded-opentype"),
    woff2: "#{$file-path}.woff2" format("woff2"),
    woff:  "#{$file-path}.woff" format("woff"),
    ttf:   "#{$file-path}.ttf" format("truetype"),
    svg:   "#{$file-path}.svg##{$font-family}" format("svg")
  );

  @each $key, $values in $formats-map {
    @if contains($file-formats, $key) {
      $file-path: nth($values, 1);
      $font-format: nth($values, 2);

      @if $asset-pipeline == true {
        $src: append($src, font-url($file-path) $font-format, comma);
      } @else {
        $src: append($src, url($file-path) $font-format, comma);
      }
    }
  }

  @return $src;
}

Version data entries

130 entries across 123 versions & 21 rubygems

Version Path
middleman-core-4.5.1 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_font-source-declaration.scss
middleman-core-4.5.0 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_font-source-declaration.scss
middleman-core-4.4.3 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_font-source-declaration.scss
middleman-core-4.4.2 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_font-source-declaration.scss
middleman-core-4.4.0 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_font-source-declaration.scss
torba-1.1.0 test/fixtures/home_path/03/bourbon/_font-source-declaration.scss
middleman-core-4.3.11 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_font-source-declaration.scss
middleman-core-4.3.10 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_font-source-declaration.scss
middleman-core-4.3.8 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_font-source-declaration.scss
middleman-core-4.3.7 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_font-source-declaration.scss
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/middleman-core-4.3.3/fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_font-source-declaration.scss
middleman-core-4.3.6 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_font-source-declaration.scss
middleman-core-4.3.5 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_font-source-declaration.scss
middleman-core-4.3.4 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_font-source-declaration.scss
middleman-core-4.3.3 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_font-source-declaration.scss
middleman-core-4.3.2 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_font-source-declaration.scss
middleman-core-4.3.1 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_font-source-declaration.scss
middleman-core-4.3.0 fixtures/minify-css-app/source/stylesheets/bourbon/helpers/_font-source-declaration.scss
federalist-basic-report-theme-0.1.7 _sass/uswds/lib/helpers/_font-source-declaration.scss
uswds-jekyll-4.2.0 _sass/uswds/lib/helpers/_font-source-declaration.scss