@import '../variables';

@mixin setSizes($min, $flex, $max) {
  font-size: $min;

  @media screen and (min-width: 320px) {
    font-size: $flex;
  }
  @media screen and (min-width: 1200px) {
    font-size: $max;
  }
}

@mixin fontSizer($maxSize, $minSize: null, $unit: 'rem') {
  $start: null;
  $slope: null;
  $end: #{$maxSize}#{$unit};
  @if ($minSize) {
    $start: #{$minSize}#{$unit};
    $slope: #{$maxSize - $minSize}/(160 - 32); //in rem

  } @else {
    $start: #{$maxSize / 2}#{$unit};
    $slope: #{$maxSize / 2}/(160 - 32); //in rem

  }
  $flex: calc(#{$slope} * (100vw - 320px) + #{$start});
  @include setSizes($start, $flex, $end)
}