6 * Adds a font specification to an element.
7 * Uses a single "font" property if possible, otherwise uses separate font-family, font-size,
8 * font-weight and line-height properties.
10 * @param {number/string} $font-weight
13 * @param {number/string} $font-size
16 * @param {number/string} $line-height
19 * @param {string} $font-family
24 @mixin font($font-weight: null, $font-size: null, $line-height: null, $font-family: null) {
25 @if $font-family == null or $font-size == null {
26 // if font-family or font-size is null we cannot use a single "font" declaration
27 font-weight: $font-weight;
28 font-size: $font-size;
29 line-height: $line-height;
30 font-family: $font-family;
31 } @else if $line-height == null {
32 font: $font-weight $font-size $font-family;
34 font: $font-weight #{$font-size}/#{$line-height} $font-family;