Rem unit calculator

SCSS
$browser-context: 16;
@function pct($value,$base) {
  @return $value / $base * 100%;
}
@function is-percentage($value) {
  @return is-number($value) and unit($value) == '%';
}
@function rem($pixels, $context: $browser-context) {
  @if(is-percentage($pixels)){
    @return $pixels;
  }
  @if (unitless($pixels)) {
    $pixels: $pixels * 1px;
  }
  @if (unitless($context)) {
    $context: $context * 1px;
  }
  @return $pixels / $context * 1rem;
}

// sample
div { width: rem(100px) }