Like Sean said the initial value for transition
is all. This does not mean you should use it like that though. It is known that using the initial value could cause drawbacks in performance, read this.
It is better if you declare each value that you want your transition be applied to. You may not see the performance hit at first, but as you keep extending your CSS file it is something you want to keep an eye on.
Examples:
Without declaring all
value:
.shape {
display: inline-block;
border-radius: 50%;
border: 20px solid;
border-color: #4285F4 #0F9D58 #F4B400 #DB4437;
width: 50px;
height: 50px;
transition: 0.5s ease-in;
}
.shape:hover {
border-radius: 0;
width: 100px;
height: 100px;
}
<div class="shape"></div>
<div class="shape"></div>
<div class="shape"></div>
<div class="shape"></div>
<div class="shape"></div>
<div class="shape"></div>
Declaring all
value:
.shape {
display: inline-block;
border-radius: 50%;
border: 20px solid;
border-color: #4285F4 #0F9D58 #F4B400 #DB4437;
width: 50px;
height: 50px;
transition: all 0.5s ease-in;
}
.shape:hover {
border-radius: 0;
width: 100px;
height: 100px;
}
<div class="shape"></div>
<div class="shape"></div>
<div class="shape"></div>
<div class="shape"></div>
<div class="shape"></div>
<div class="shape"></div>
Better performance:
.shape {
display: inline-block;
border-radius: 50%;
border: 20px solid;
border-color: #4285F4 #0F9D58 #F4B400 #DB4437;
width: 50px;
height: 50px;
transition: border-radius 0.5s ease-in, width 0.5s ease-in, height 0.5s ease-in;
}
.shape:hover {
border-radius: 0;
width: 100px;
height: 100px;
}
<div class="shape"></div>
<div class="shape"></div>
<div class="shape"></div>
<div class="shape"></div>
<div class="shape"></div>
<div class="shape"></div>
Even better Perfomance
If you can afford the element overlap and the border-width
increment to avoid redraw.
.shape {
display: inline-block;
border-radius: 50%;
border: 20px solid;
border-color: #4285F4 #0F9D58 #F4B400 #DB4437;
width: 50px;
height: 50px;
transition: border-radius 0.5s ease-in, transform 0.5s ease-in;
transform-origin: top left;
}
.shape:hover {
border-radius: 0;
transform: scale(2);
}
<div class="shape"></div>
<div class="shape"></div>
<div class="shape"></div>
<div class="shape"></div>
<div class="shape"></div>
<div class="shape"></div>
Read this for further explanation.