Skip to content

Instantly share code, notes, and snippets.

@apfelbox
Created June 25, 2014 11:34
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 apfelbox/c0e183c4f529bc21b5ec to your computer and use it in GitHub Desktop.
Save apfelbox/c0e183c4f529bc21b5ec to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.8)
// Compass (v1.0.0.alpha.19)
// ----
@mixin fontface($fontname: "", $fontfile: "", $path: "", $weightnames: "", $weightnos: "", $fontvariant: "") {
$totalnofonts: length($weightnames);
@if ($totalnofonts > 0) {
$path: $path + $fontfile;
$i: 0;
@while $i < $totalnofonts {
$weightnameidx: $i + 1;
$weightno: nth($weightnos, $weightnameidx);
$weightname: nth($weightnames, $weightnameidx);
@font-face {
font-family: "#{$fontname}";
src: url('#{$path}-#{nth($weightnames, $weightnameidx)}#{$fontvariant}.eot');
src:
url('#{$path}-#{nth($weightnames, $weightnameidx)}#{$fontvariant}.eot?#iefix') format('embedded-opentype'),
url('#{$path}-#{nth($weightnames, $weightnameidx)}#{$fontvariant}.woff') format('woff'),
url('#{$path}-#{nth($weightnames, $weightnameidx)}#{$fontvariant}.svg##{$fontfile}#{$weightname}') format('svg'),
url('#{$path}-#{nth($weightnames, $weightnameidx)}#{$fontvariant}.ttf') format('truetype');
font-weight: $weightno;
font-style: normal;
}
$i: $i + 1;
}
}
}
@include fontface(Argumentum, argumentum, "/css/fonts/", ("black" "bold" "medium" "regular" "light" "ultralight"), (900 700 500 400 300 100));
@font-face {
font-family: "Argumentum";
src: url("/css/fonts/argumentum-black.eot");
src: url("/css/fonts/argumentum-black.eot?#iefix") format("embedded-opentype"), url("/css/fonts/argumentum-black.woff") format("woff"), url("/css/fonts/argumentum-black.svg#argumentumblack") format("svg"), url("/css/fonts/argumentum-black.ttf") format("truetype");
font-weight: 900;
font-style: normal;
}
@font-face {
font-family: "Argumentum";
src: url("/css/fonts/argumentum-bold.eot");
src: url("/css/fonts/argumentum-bold.eot?#iefix") format("embedded-opentype"), url("/css/fonts/argumentum-bold.woff") format("woff"), url("/css/fonts/argumentum-bold.svg#argumentumbold") format("svg"), url("/css/fonts/argumentum-bold.ttf") format("truetype");
font-weight: 700;
font-style: normal;
}
@font-face {
font-family: "Argumentum";
src: url("/css/fonts/argumentum-medium.eot");
src: url("/css/fonts/argumentum-medium.eot?#iefix") format("embedded-opentype"), url("/css/fonts/argumentum-medium.woff") format("woff"), url("/css/fonts/argumentum-medium.svg#argumentummedium") format("svg"), url("/css/fonts/argumentum-medium.ttf") format("truetype");
font-weight: 500;
font-style: normal;
}
@font-face {
font-family: "Argumentum";
src: url("/css/fonts/argumentum-regular.eot");
src: url("/css/fonts/argumentum-regular.eot?#iefix") format("embedded-opentype"), url("/css/fonts/argumentum-regular.woff") format("woff"), url("/css/fonts/argumentum-regular.svg#argumentumregular") format("svg"), url("/css/fonts/argumentum-regular.ttf") format("truetype");
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: "Argumentum";
src: url("/css/fonts/argumentum-light.eot");
src: url("/css/fonts/argumentum-light.eot?#iefix") format("embedded-opentype"), url("/css/fonts/argumentum-light.woff") format("woff"), url("/css/fonts/argumentum-light.svg#argumentumlight") format("svg"), url("/css/fonts/argumentum-light.ttf") format("truetype");
font-weight: 300;
font-style: normal;
}
@font-face {
font-family: "Argumentum";
src: url("/css/fonts/argumentum-ultralight.eot");
src: url("/css/fonts/argumentum-ultralight.eot?#iefix") format("embedded-opentype"), url("/css/fonts/argumentum-ultralight.woff") format("woff"), url("/css/fonts/argumentum-ultralight.svg#argumentumultralight") format("svg"), url("/css/fonts/argumentum-ultralight.ttf") format("truetype");
font-weight: 100;
font-style: normal;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment