How to apply CSS transition only to transform property

I currently have transform: rotate(45deg)one that is used using the checkbox value :checked, and I'm looking for a solution, so the CSS transition only applies to the conversion value. Now I have this setting transition: all 1s ease. I don't want it applied to all , but just converted. Right now he is applying the transition to change , which I would like to get rid of. color:

It seems to me that it was easy to find the answer, but it turned out to be more difficult than I imagined. Let me know if you have any questions. Thanks.

Here is my code handle . This code is CSS lines 25-28 .

+4
source share
1 answer

you can use transition: transform 1s;

This is a shorthand for:

transition-property: transform;
transition-duration: 1s;

For prefixes you need:

-webkit-transition: -webkit-transform 1s;
/* etc, for each possibility */
+5
source

Source: https://habr.com/ru/post/1523452/


All Articles