I have property like this
transition: top .5s, transform .5s .5s;
And usually, for better performance, we should use only transform and opacity for animate.
It is possible to animate like this?
transition: transform(translateY) .5s, transform(rotate) .5s .5s;
document.querySelector(".burger").onclick = function(e) {toggleActive(e)};
function toggleActive({target}) {
target.classList.toggle('active')
}
span {
top: 50%;
transform: translateY(-50%);
transition: background-color 0.1s 0.5s;
}
span, span:before, span:after {
background-color: #555;
height: 5px;
width: 35px;
display: block;
border-radius: 5px;
position: absolute;
animation-duration: 3s;
animation-fill-mode: forwards;
}
span:before, span:after {
content: '';
}
.basic:before, .basic:after {
transition: transform 0.5s, top 0.5s 0.5s;
}
span:before {
top: 200%;
}
span:after {
top: -200%;
}
.basic.active {
background-color: rgba(0, 0, 0, 0);
}
.basic.active:before {
transform: rotate(-45deg);
}
.basic.active:after {
transform: rotate(45deg);
}
.basic.active:before, .basic.active:after {
top: 0;
transition: top 0.5s, transform 0.5s 0.5s;
}
<span class="burger basic"></span>
In this case, I did use top property. And I wanna transition the properties of transform.
I don't need any patches using JS. The only question is whether there is such a possibility at all. I might add that I originally use SCSS.