@use 'sass:list';

// Source https://joshbroton.com/quick-fix-sass-mixins-for-css-keyframe-animations/
@mixin animation($animate...) {
  $max: list.length($animate);
  $animations: '';

  @for $i from 1 through $max {
    $animations: #{$animations + list.nth($animate, $i)};

    @if $i < $max {
      $animations: #{$animations + ', '};
    }
  }

  animation: $animations;
}

@mixin keyframes($animationName) {
  @keyframes #{$animationName} {
    @content;
  }

  @keyframes #{$animationName} {
    @content;
  }

  @keyframes #{$animationName} {
    @content;
  }
}
