_font-face.scss 1.0 KB

1234567891011121314151617181920212223
  1. // Order of the includes matters, and it is: normal, bold, italic, bold+italic.
  2. @mixin font-face($font-family, $file-path, $weight: normal, $style: normal, $asset-pipeline: false ) {
  3. @font-face {
  4. font-family: $font-family;
  5. font-weight: $weight;
  6. font-style: $style;
  7. @if $asset-pipeline == true {
  8. src: font-url('#{$file-path}.eot');
  9. src: font-url('#{$file-path}.eot?#iefix') format('embedded-opentype'),
  10. font-url('#{$file-path}.woff') format('woff'),
  11. font-url('#{$file-path}.ttf') format('truetype'),
  12. font-url('#{$file-path}.svg##{$font-family}') format('svg');
  13. } @else {
  14. src: url('#{$file-path}.eot');
  15. src: url('#{$file-path}.eot?#iefix') format('embedded-opentype'),
  16. url('#{$file-path}.woff') format('woff'),
  17. url('#{$file-path}.ttf') format('truetype'),
  18. url('#{$file-path}.svg##{$font-family}') format('svg');
  19. }
  20. }
  21. }