3 /// Builds the `src` list for an `@font-face` declaration.
5 /// @link https://goo.gl/Ru1bKP
7 /// @argument {string} $font-family
9 /// @argument {string} $file-path
11 /// @argument {boolean} $asset-pipeline
13 /// @argument {list} $file-formats
17 /// @require {function} _contains
21 @function _font-source-declaration(
30 eot: "#{$file-path}.eot?#iefix" format("embedded-opentype"),
31 woff2: "#{$file-path}.woff2" format("woff2"),
32 woff: "#{$file-path}.woff" format("woff"),
33 ttf: "#{$file-path}.ttf" format("truetype"),
34 svg: "#{$file-path}.svg##{$font-family}" format("svg"),
37 @each $key, $values in $formats-map {
38 @if _contains($file-formats, $key) {
39 $file-path: nth($values, 1);
40 $font-format: nth($values, 2);
42 @if $asset-pipeline == true {
43 $src: append($src, font-url($file-path) $font-format, comma);
45 $src: append($src, url($file-path) $font-format, comma);