%_animate-background {
  display: inline;
  line-height: 1;
  background-image: linear-gradient(0deg,
    var(--animate-background--gradient-color) 0%,
    var(--animate-background--gradient-color) 100%
  );
  background-size:
    var(--animate-background--bg-size--width, 0%)
    var(--animate-background--bg-size--height, 0%);
  background-repeat: no-repeat;
  background-position: var(--animate-background--bg-position);
  color: var(--animate-background--color);
  transition: all 200ms ease-in-out;

  &:hover,
  &:focus-visible {
    color: var(--animate-background--color--active, var(--animate-background--color));
  }
}

%animate-background-to-top {
  --animate-background--bg-size--width: 100%;
  --animate-background--bg-position: bottom;
  @extend %_animate-background;

  &:hover,
  &:focus-visible {
    --animate-background--bg-size--height: 100%;
  }
}

%animate-background-to-bottom {
  --animate-background--bg-size--width: 100%;
  --animate-background--bg-position: top;
  @extend %_animate-background;

  &:hover,
  &:focus-visible {
    --animate-background--bg-size--height: 100%;
  }
}

%animate-background-to-left {
  --animate-background--bg-size--height: 100%;
  --animate-background--bg-position: left;
  @extend %_animate-background;

  &:hover,
  &:focus-visible {
    --animate-background--bg-size--width: 100%;
  }
}

%animate-background-to-right {
  --animate-background--bg-size--height: 100%;
  --animate-background--bg-position: right;
  @extend %_animate-background;

  &:hover,
  &:focus-visible {
    --animate-background--bg-size--width: 100%;
  }
}
