// FUNCTIONS: Camelize string

// Modules imports
@use "sass:string";

// @arguments [string] $string
// @return camelcase string
@function camelize($string) {
  $progress: $string;
  $result: "";
  $exclude: " ", "-", "–", "—", "_", ",", ";", ":", ".";

  @while str-length($progress) > 0 {
    $char: string.slice($progress, 1, 1);

    @if contain($exclude, $char) {
      $progress: capitalize(string.slice($progress, 2, 2)) + string.slice($progress, 3);
    } @else {
      $result: $result + $char;
      $progress: string.slice($progress, 2);
    }
  }

  @return $result;
}
