Skip to content

Instantly share code, notes, and snippets.

@passcod
Created February 21, 2012 20:46
Show Gist options
  • Save passcod/1878817 to your computer and use it in GitHub Desktop.
Save passcod/1878817 to your computer and use it in GitHub Desktop.
SCSS font-feature Mixin
@mixin font-features($features: (liga, rlig)) {
$feature_string: "";
$moz_feature_string: "";
@each $feature in $features {
$feature_string: $feature_string + " \"" + $feature + "\" 1";
$moz_feature_string: $moz_feature_string + " \"" + $feature + "=1\"";
@if nth($features, length($features)) != $feature {
$feature_string: $feature_string + ",";
$moz_feature_string: $moz_feature_string + ",";
}
}
-moz-font-features: #{$moz_feature_string};
@each $bro in ("-webkit-", "-ms-", "-o-", "") {
#{$bro}font-features: #{$feature_string};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment