Ах, я заставил это работать, пока только некоторые незначительные ошибки в соглашении об именах, но теперь он не нарушается:)
@motion-common() {
animation-duration: .3s;
animation-fill-mode: both;
display: block !important;
}
@make-motion($className, $keyframeName) {
$className {
&-enter, &-appear {
@motion-common();
animation-play-state: paused;
}
&-leave {
@motion-common();
animation-play-state: paused;
}
&-enter.&-enter-active,
&-appear.&-appear-active {
animation-name: ~"${keyframeName}In";
animation-play-state: running;
}
&-leave.&-leave-active {
animation-name: ~"${keyframeName}Out";
animation-play-state: running;
}
}
}
@zoom-motion($className, $keyframeName) {
@make-motion($className, $keyframeName);
$className {
&-enter, &-appear {
transform: scale(0, 0); // need this by yiminghe
animation-timing-function: $ease-out-quint;
}
&-leave {
animation-timing-function: $ease-in-quint;
}
}
}
@zoom-motion(rc-slider-tooltip-zoom-down, rcSliderTooltipZoomDown);
@keyframes rcSliderTooltipZoomDownIn {
0% {
opacity: 0;
transform-origin: 50% 100%;
transform: scale(0, 0);
}
100% {
transform-origin: 50% 100%;
transform: scale(1, 1);
}
}
@keyframes rcSliderTooltipZoomDownOut {
0% {
transform-origin: 50% 100%;
transform: scale(1, 1);
}
100% {
opacity: 0;
transform-origin: 50% 100%;
transform: scale(0, 0);
}
}