Skip to content

Instantly share code, notes, and snippets.

@stephenparish
Created December 2, 2014 15:00
Show Gist options
  • Save stephenparish/13997acc453e120b41ef to your computer and use it in GitHub Desktop.
Save stephenparish/13997acc453e120b41ef to your computer and use it in GitHub Desktop.
A shorthand @font-face mixin
.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