Last active
December 13, 2015 21:48
-
-
Save trent-boyd/4979472 to your computer and use it in GitHub Desktop.
LESS: Quick & Dirty @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(@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'); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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. :)