@use 'sass:string';
@use 'sass:list';
@use 'sass:math';
@use 'sass:map';
@use '../base/variable' as v;

@function remove-unit($value) {
  @return math.div($value, ($value * 0 + 1));
}

@function em($size, $font-size: v.$font-size) {
  @return #{math.div(remove-unit($size), remove-unit($font-size)) em};
}

@function rem($size, $font-size: v.$font-size) {
  @return #{math.div(remove-unit($size), remove-unit($font-size))}rem;
}

@function font-weight-to-number($weight) {
  $first-upper-case: string.to-upper-case(string.slice($weight, 1, 1)) + string.slice($weight, 2);

  @return map.get(v.$font-info, $first-upper-case);
}

@function division($num1, $num2) {
  @return math.div(remove-unit($num1), remove-unit($num2));
}
