/**
 * Extend configuration with relative line height value based on font size and absolute line height
 *
 * Example
 * $config: (size: 16px, line-height-abs: 24px)
 * @debug line-height-get($config) // (size: 16px, line-height-abs: 24px, line-height: 1.5)
 */
@function line-height-get($map) {
  @if map-has-key($map, "size") and map-has-key($map, "line-height-abs") {
    $line-height: (
      line-height: relative-line-height(map-get($map, "size"), map-get($map, "line-height-abs")),
    );

    @return map-merge($map, $line-height);
  }

  @return $map;
}

/**
 * Calculate relative line height based on font size and absolute line height
 *
 * Example
 * for font size of 16px and a line-height of 24px
 * @debug relative-line-height(16px, 24px) // 1.5
 */
@function relative-line-height($font-size, $line-height) {
  @return $line-height / $font-size;
}
