Skip to content

Instantly share code, notes, and snippets.

@mavisland
Created February 17, 2015 14:09
Show Gist options
  • Select an option

  • Save mavisland/45f0d1792e05f0051faa to your computer and use it in GitHub Desktop.

Select an option

Save mavisland/45f0d1792e05f0051faa to your computer and use it in GitHub Desktop.
Web font loading mixin for LESS
// Load web-font
.load-font(@family: Arial, @name: "font", @path: "../fonts/", @weight: normal, @style: normal) {
@font-face {
font-family: '@{family}';
src: url('@{path}@{name}.eot');
src: url('@{path}@{name}.eot?#iefix') format('embedded-opentype'),
url('@{path}@{name}.woff2') format('woff2'),
url('@{path}@{name}.woff') format('woff'),
url('@{path}@{name}.ttf') format('truetype'),
url('@{path}@{name}.svg#@{family}') format('svg');
font-weight: @weight;
font-style: @style;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment