Skip to content

Instantly share code, notes, and snippets.

@trent-boyd
Last active December 13, 2015 21:48
Show Gist options
  • Save trent-boyd/4979472 to your computer and use it in GitHub Desktop.
Save trent-boyd/4979472 to your computer and use it in GitHub Desktop.
LESS: Quick & Dirty @font-face Mixin
.font(@name, @file, @style: normal, @weight: normal) {
@font-face {
font-family: @name;
src: url('../fonts/@{file}.eot');
src: url('../fonts/@{file}.eot?#iefix') format('embedded-opentype'),
url('../fonts/@{file}.svg') format('svg'),
url('../fonts/@{file}.ttf') format('truetype');
font-style: @style;
font-weight: @weight;
}
}
/* USAGE
.font('Designosaur', 'designosaur-regular-webfont');
*/
@trent-boyd
Copy link
Author

Oh, the servers I'm using don't server up the correct WOFF mimetype, resulting in a 404 every time. Most people won't have that issue, so feel free to add in your own around line 6. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment