HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/Neopoints/momsecurity.be/resources/sass/2-Tools/_tools.fonts.scss
/* ==========================================================================
 * Font related functions
 * ========================================================================== */


/**
 *  Mixin for setting font-size in REM through a Sass Map with all available sizes

    USAGE:

    .myClass {
        @include font-size(xl);
    }

 */


@mixin font-size($fs, $lh: null) {
  // Get correct key with font-size and line-height px value
  $font-size-properties: map-get($font-sizes, $fs);
  @if $font-size-properties {
    @include font-size(map-get($font-size-properties, font-size));

    @if($lh == null){
      line-height: map-get($font-size-properties, line-height) / map-get($font-size-properties, font-size);
    } @else {
      line-height: $lh / map-get($font-size-properties, font-size);
    }
  }
  // When mapping isn't found calculate as if PX-value was given and return REM value
  @else {
    @if is-number($fs) {
      font-size: valueToRem($fs);

      @if($lh != null){
        line-height: $lh / $fs;
      }
    }
    @else {
      @warn " `#{$fs}` is not a valid value. It must be one of the following: `#{$font-sizes}`";
    }
  }
}


//TODO: remove function and uses
@mixin font($size, $lh: null, $weight: null) {
  @include font-size($size, $lh);
}