@use 'sass:math';

@function content-width($width, $margin, $sidenav: false) {
  // prettier doesn't understand the new sass if syntax
  // prettier-ignore
  $side-width: if(
    sass($sidenav): 17; else: 0
  );

  @return $width - $side-width - 2 * $margin;
}

@function calculate-rem($px) {
  @return math.div($px, 16px) * 1rem;
}

@function calculate-px($rem) {
  @return math.div($rem, 1rem) * 16px;
}
