Created
December 2, 2014 15:00
-
-
Save stephenparish/13997acc453e120b41ef to your computer and use it in GitHub Desktop.
A shorthand @font-face mixin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.font(@family, @url, @weight: normal, @style: normal) { | |
@font-face { | |
font-family: @family; | |
src: url('@{url}.eot'); // IE9 Compat Modes | |
src: url('@{url}.eot?#iefix') format('embedded-opentype'), // IE6-IE8 | |
url('@{url}.woff') format('woff'), // Modern Browsers | |
url('@{url}.ttf') format('truetype'); // Safari, Android, iOS | |
// url('@{url}.svg') format('svg'); // Legacy iOS, pre-4.2, unecessary if not supporting that far. | |
font-weight: @weight; | |
font-style: @style; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment