Skip to content

Instantly share code, notes, and snippets.

@LoyEgor
Last active July 16, 2017 17:41
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 LoyEgor/29bc79c67bbe12434910052a22810cb4 to your computer and use it in GitHub Desktop.
Save LoyEgor/29bc79c67bbe12434910052a22810cb4 to your computer and use it in GitHub Desktop.
mixin for easier custom font use
@fdir: '../fonts/';
@ff-name: 'CirceRoundedAlt';
@rg: '@{ff-name}-Regular1';
@bd: '@{ff-name}-Regular2';
.ff(@ff) {
font-family: e(replace(@ff, @ff-name, "cust-ff")), Arial, Helvetica Neue, Helvetica, sans-serif;
}
.ff-mix(@ff) {
@font-face {
font-family: e(replace(@ff, @ff-name, "cust-ff"));
src: url('@{fdir}@{ff}.eot');
src: url('@{fdir}@{ff}.eot?#iefix') format('embedded-opentype'),
url('@{fdir}@{ff}.otf') format('opentype'),//remove if not exist
url('@{fdir}@{ff}.woff2') format('woff2'),
url('@{fdir}@{ff}.woff') format('woff'),
url('@{fdir}@{ff}.ttf') format('truetype'),
url('@{fdir}@{ff}.svg#@{ff}') format('svg');
font-weight: normal;
font-style: normal;
}
}
.ff-mix(@rg);
.ff-mix(@bd);
// .class{
// .ff(@bd);
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment