@import '../themes/index';

.yee-motion-common(@yee-duration: @yee-animation-duration-base) {
  animation-duration: @yee-duration;
  animation-fill-mode: both;
}

.yee-motion-common-leave(@yee-duration: @yee-animation-duration-base) {
  animation-duration: @yee-duration;
  animation-fill-mode: both;
}

.yee-make-motion(@yee-className, @keyframeName, @yee-duration: @yee-animation-duration-base) {
  .@{yee-className}-enter,
  .@{yee-className}-appear {
    .yee-motion-common(@yee-duration);

    animation-play-state: paused;
  }
  .@{yee-className}-leave {
    .yee-motion-common-leave(@yee-duration);

    animation-play-state: paused;
  }
  .@{yee-className}-enter.@{yee-className}-enter-active,
  .@{yee-className}-appear.@{yee-className}-appear-active {
    animation-name: ~'@{keyframeName}In';
    animation-play-state: running;
  }
  .@{yee-className}-leave.@{yee-className}-leave-active {
    animation-name: ~'@{keyframeName}Out';
    animation-play-state: running;
    pointer-events: none;
  }
}
