Skip to content

Instantly share code, notes, and snippets.

@tcoukoulis
Last active September 15, 2017 04:59
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 tcoukoulis/b7c32297ec30893543cd74723ad803a4 to your computer and use it in GitHub Desktop.
Save tcoukoulis/b7c32297ec30893543cd74723ad803a4 to your computer and use it in GitHub Desktop.
SCSS mixin for font shorthand
// ----
// libsass (v3.5.0.beta.2)
// ----
@mixin font($dimensions, $family, $props: null) {
font: $props $dimensions #{$family};
}
.foo {
@include font(14px, "Monaco, Menlo", null);
}
.bar {
@include font(#{14px/150%}, "Menlo, Arial")
}
.baz {
@include font(#{12rem/102%}, '"Space Invaders", Arial, Helvetica', 500 italic);
}
.foo {
font: 14px Monaco, Menlo;
}
.bar {
font: 14px/150% Menlo, Arial;
}
.baz {
font: 500 italic 12rem/102% "Space Invaders", Arial, Helvetica;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment