/* ============================================================================
   @CORE -> MIXINS -> FONT SIZE
   ========================================================================= */


/**
 * Create a fully formed type style (sizing and vertical rhythm) by passing in
 * a single value, e.g.:
 *
   .foo {@include font-size(12);}
 *
 * This will generate a rem-based font-size, as well as a unitless line-height
 * which will place the element on your baseline, e.g.:
 *
   .foo {
     font-size: 0.75rem;
     line-height: 2;
   }
 *
 * If you do not want Scally to generate you a line-height automatically, you
 * simply pass in your own as a second parameter:
 *
   .foo {@include font-size(12, 1.5);}
 *
 * This will yield:
 *
   .foo {
     font-size: 0.75rem;
     line-height: 1.5;
   }
 *
 * This parameter can be any integer, `inherit`, or `normal`. If you don't
 * want a line-height at all, pass in a second parameter of `none` or `false`:
 *
   .foo {@include font-size(12, none);}
 *
 * This will yield:
 *
   .foo {font-size: 0.75rem;}
 *
 * @example
   @include font-size(18);
   @include font-size(12, 1.5);
   @include font-size(12, none);
   @include font-size(24, inherit);
   @include font-size(24, normal);
   @include font-size(24, normal, true); or
   @include font-size(24, normal, !important);
 *
 * @credit
 * https://github.com/inuitcss/tools.mixins/blob/master/_tools.mixins.scss
 */


@mixin font-size($font-size-value, $line-height-value: auto, $sledgehammer: false) {

  $important: if($sledgehammer, " !important", "");
  font-size: ($font-size-value / $font-size) * 1rem#{$important};

  @if $line-height-value == auto {
    line-height: ceil($font-size-value / $line-height) * ($line-height /
      $font-size-value)#{$important};
  }
  @else {

    @if (type-of($line-height-value) == number or $line-height-value == inherit
      or $line-height-value == normal) {
      line-height: $line-height-value#{$important};
    }
    @elseif ($line-height-value != none and $line-height-value != false) {
      @warn "D'oh! `#{$line-height-value}` is not a valid value for `line-height`."
    }// endif
  }// endif
}