  /// Trims leading and trailing whitespace from a string.
  ///

  @function str-trim ($str) {
    $output: $str;
    @if (str-slice($output, 1, 1) == ' ') {
        $output: str-trim(str-slice($output, 2));
    }

    @if (str-slice($output, str-length($output), -1) == ' ') {
        $output: str-trim(str-slice($output, 1, -2));
    }

    @return $output;
  }