Skip to content

Instantly share code, notes, and snippets.

@morganfeeney
Last active April 20, 2016 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save morganfeeney/1454c2ae8fb90fe9e5515b2fff19acae to your computer and use it in GitHub Desktop.
Save morganfeeney/1454c2ae8fb90fe9e5515b2fff19acae to your computer and use it in GitHub Desktop.
@theme-name: "common";
@base-url: "url/@{theme-name}";
@font-face-file-path: "@{base-url}/fonts";
.font-face(
@font-face-family;
@font-face-file-name;
@font-face-file-path: @font-face-file-path;
@font-face-directory: @font-face-family;
@font-face-weight: normal;
@font-face-style: normal
) {
@font-face {
font-family: '@{font-face-family}';
src: url('@{font-face-file-path}/@{font-face-directory}/@{font-face-file-name}.eot');
src:
url('@{font-face-file-path}/@{font-face-directory}/@{font-face-file-name}.eot#eifix') format('embedded-opentype'),
url('@{font-face-file-path}/@{font-face-directory}/@{font-face-file-name}.woff') format('woff'),
url('@{font-face-file-path}/@{font-face-directory}/@{font-face-file-name}.ttf') format('truetype'),
url('@{font-face-file-path}/@{font-face-directory}/@{font-face-file-name}.svg#@{font-face-family}') format('svg');
font-weight: @font-face-weight;
font-style: @font-face-style;
}
/// Chrome for Windows rendering fix: http://www.adtrak.co.uk/blog/font-face-chrome-rendering/
@media screen and (-webkit-min-device-pixel-ratio: 0) {
@font-face {
font-family: '@{font-face-file-path}/@{font-face-directory}/@{font-face-file-name}';
src: url('@{font-face-file-path}/@{font-face-directory}/@{font-face-file-name}#@{font-face-family}') format('svg');
}
}
}
.font-face(Manus;manus-webfont);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment