forked from Compass/compass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_font-face.scss
33 lines (30 loc) · 1.11 KB
/
_font-face.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
@charset "UTF-8";
@import "shared";
// Cross-browser support for @font-face. Supports IE, Gecko, Webkit, Opera.
//
// * $name is required, arbitrary, and what you will use in font stacks.
// * $font-files is required using font-files('relative/location', 'format').
// for best results use this order: woff, opentype/truetype, svg
// * $eot is required by IE, and is a relative location of the eot file.
@mixin font-face($name, $font-files, $eot: false, $postscript: false, $style: false) {
@if $postscript or $style {
@warn "The $postscript and $style variables have been deprecated in favor of the Paul Irish smiley bulletproof technique.";
}
@font-face {
font-family: quote($name);
@if $eot { src: font-url($eot); }
src: local("☺"), $font-files;
}
}
// EXAMPLE
// +font-face("this name", font-files("this.woff", "woff", "this.otf", "opentype"), "this.eot")
//
// will generate:
//
// @font-face {
// font-family: 'this name';
// src: url('fonts/this.eot');
// src: local("☺"),
// url('fonts/this.otf') format('woff'),
// url('fonts/this.woff') format('opentype');
// }