/// Convert unit to px, em, rem, or %
/// @access private
/// @param {Number} $units- Units to convert to
/// @param {Number} $value - Starting px value
/// @return {Number} $context - Context font-size in px
/// @require {function} fs-em
/// @require {function} fs-rem
@function fs-convert-units($units, $value, $context) {
  @if unit($value) != 'px' or unit($context) != 'px' {
    @error '🔴  fs-convert-units() only accepts pixel values';
  }

  // Percentage
  @if $units == '%' {
    @if unit($value) == '%' {
      @return $value;
    }
    @else {
      @return percentage($value / $context);
    }
  }

  // Pixels
  @else if $units == 'px' {
    @return $value;
  }

  // Ems
  @else if $units == 'em' {
    @return fs-em($value, $context);
  }

  // Rems
  @else if $units == 'rem' {
    @return fs-rem($value);
  }

  // Unsupported output unit
  @else {
    @error '🔴  “#{$units}” is not a valid output unit for fs-convert-units()';
  }
};

/// Convert unit to px, em, rem, or %
/// @access private
/// @param {Number} $units- Units to convert to
/// @param {Number} $value - Starting px value
/// @return {Number} $context - Context font-size in px
/// @require {function} fs-em
/// @require {function} fs-rem
@function fs-convert-units($units, $value, $context: $fs-base-font-size) {
  @if unit($value) != 'px' or unit($context) != 'px' {
    @error '🔴  fs-convert-units() only accepts pixel values';
  }

  // Percentage
  @if $units == '%' {
    @if unit($value) == '%' {
      @return $value;
    }
    @else {
      @return percentage($value / $context);
    }
  }

  // Pixels
  @else if $units == 'px' {
    @return $value;
  }

  // Ems
  @else if $units == 'em' {
    @return fs-em($value, $context);
  }

  // Rems
  @else if $units == 'rem' {
    @return fs-rem($value);
  }

  // Unsupported output unit
  @else {
    @error '🔴  “#{$units}” is not a valid output unit for fs-convert-units()';
  }
};

Set default context to global base font-size variable
Set default context to global base font-size variable
