@use 'sass:map';
// Font utilities
// Mixin take size in parameter
// @see _breakpoints.scss
// Every class are generated with breakpoints prefix

// Available fonts with line height(key / size)

$font: (
  'text-xs': (
    'size': 0.75rem,
    'height': 1.125rem
  ),
  'text-sm': (
    'size': 0.875rem,
    'height': 1.5rem
  ),
  'text-base': (
    'size': 1rem,
    'height': 1.5rem
  ),
  'text-lg': (
    'size': 1.125rem,
    'height': 1.6875rem
  ),
  'text-xl': (
    'size': 1.25rem,
    'height': 1.75rem
  ),
  'text-2xl': (
    'size': 1.5rem,
    'height': 2rem
  ),
  'text-3xl': (
    'size': 1.875rem,
    'height': 2.25rem
  ),
  'text-4xl': (
    'size': 2.25rem,
    'height': 2.5rem
  )
);

@mixin mic-font-utilities($size: '') {
  @each $class, $property in $font {
    $font-size: map.get($property, 'size');
    $line-height: map.get($property, 'height');

    .#{$size + $class} {
      font-size: $font-size;
      line-height: $line-height;
    }
  }
}
