Skip to content

Instantly share code, notes, and snippets.

@jeffskelton3
Created October 13, 2015 16:38
Show Gist options
  • Save jeffskelton3/37225c2b955c79b0c8e6 to your computer and use it in GitHub Desktop.
Save jeffskelton3/37225c2b955c79b0c8e6 to your computer and use it in GitHub Desktop.
a reusable less mixing for importing web fonts. Assumes all files in the same directory and name exactly the same except for their respective extensions.
.import-font(@fileName, @filePath, @fontFamily){
@font-face {
font-family: @fontFamily;
src: url('@{filePath}@{fileName}.eot');
src: url('@{filePath}@{fileName}.eot?#iefix') format('embedded-opentype'),
url('@{filePath}@{fileName}.woff') format('woff'),
url('@{filePath}@{fileName}.ttf') format('truetype'),
url('@{filePath}@{fileName}.svg#@{fileName}') format('svg');
font-weight: normal;
font-style: normal;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment