// ============================================================================
// 02-TOOLS -> MIXINS -> #FONT-SIZE
// ============================================================================

//
// SCSS imports
//

@use '../../01-settings' as *;
@use './media-breakpoint' as *;

 
/// Font size
///
/// Takes a font size from as an argument and uses it to create font-size and
/// line-height declarations.
///
/// @param {String} $size - Name of size in the $font-size map
/// (set in `01-settings/_typography.scss`)
/// 
/// @example scss
///   .class-name {
///     @include font-size('md');
///   }
/// 
/// @access public


@mixin font-size($size) {
    @if not map-has-key($font-size, $size) {
        @error "Unknown font size `#{$size}`. Make sure you are using a size from the font size map in `01-settings/_typography.scss`.";
    }
    
    $size-map: map-get($font-size, $size);
    
    font-size: map-get($size-map, 'font-size');
    line-height: map-get($size-map, 'line-height');
}