@mixin animation (
  $name,
  $duration: $transition-very-very-slow,
  $easing: null,
  $count: infinite,
  $direction: normal
) {
  animation-name: $name;
  animation-duration: $duration;
  animation-iteration-count: $count;
  animation-direction: $direction;

  // Use explicitly defined easing
  @if $easing {
    animation-timing-function: $easing;
  }

  // Default to linear for infinite animations
  @else if $count == infinite {
    animation-timing-function: linear;
  }

}
