dist/_scut.scss in scut-0.9.0 vs dist/_scut.scss in scut-0.9.1

- old
+ new

@@ -1,8 +1,8 @@ /* * Scut, a collection of Sass utilities to ease and improve our implementations of common style-code patterns. -* v0.9.0 +* v0.9.1 * Docs at http://davidtheclark.github.io/scut */ // SCUT CLEARFIX // http://davidtheclark.github.io/scut/#clearfix @@ -1426,15 +1426,40 @@ $scut-whitecircle: "\25cb"; // SCUT FONT-FACE // http://davidtheclark.github.io/scut/#font-face +@function main-src($formats, $file-path, $font-family) { + // Return the list of `src` values, in order, that + // a good `@font-face` will need, including only + // those formats specified in the list `$formats`. + $result: (); + @if index($formats, eot) { + $eot-val: url('#{$file-path}.eot?#iefix') format('embedded-opentype'); + $result: append($result, $eot-val, comma); + } + @if index($formats, woff) { + $woff-val: url('#{$file-path}.woff') format('woff'); + $result: append($result, $woff-val, comma); + } + @if index($formats, ttf) { + $ttf-val: url('#{$file-path}.ttf') format('truetype'); + $result: append($result, $ttf-val, comma); + } + @if index($formats, svg) { + $svg-val: url('#{$file-path}.svg##{$font-family}') format('svg'); + $result: append($result, $svg-val, comma); + } + @return $result; +} + @mixin scut-font-face ( $font-family, $file-path, $weight: normal, - $style: normal + $style: normal, + $formats: eot woff ttf svg ) { @if index('italic' 'oblique', $weight) { $style: $weight; $weight: normal; @@ -1443,14 +1468,13 @@ @font-face { font-family: $font-family; font-weight: $weight; font-style: $style; - src: url('#{$file-path}.eot'); - src: url('#{$file-path}.eot?#iefix') format('embedded-opentype'), - url('#{$file-path}.woff') format('woff'), - url('#{$file-path}.ttf') format('truetype'), - url('#{$file-path}.svg##{$font-family}') format('svg'); + @if index($formats, eot) { + src: url('#{$file-path}.eot'); + } + src: main-src($formats, $file-path, $font-family); } } // SCUT HANGING INDENT \ No newline at end of file