0

Just out of curiosity, is there any difference in terms of performance values if you use specific properties, e.g. transition: color .3s, against a general property transition: all .3s?

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
sdvnksv
  • 9,350
  • 18
  • 56
  • 108

3 Answers3

0

Letting the browser control animations sequences allows it to optimize performance and efficiency by altering the frame rate, minimizing paints and offloading some of the work to the GPU.

The performance penalty of all vs. color in mentioned case (if any) should be negligible to notice (microseconds).

See here for more details.

Bud Damyanov
  • 30,171
  • 6
  • 44
  • 52
0

They should perform similarly if only the color changes, but it will apply with any change in styling on the given element. The difference, if any, is probably not perceivable with most modern browsers.

It's a distinct possibility that "all" is optimized to ensure only the necessary proprieties are followed.

So the only thing to take into consideration is the possibility that another propriety will change and you don't want the 0.3s transition on it.

Vlad Pintea
  • 813
  • 8
  • 24
0

There are many sources that explain the performance issues of animations and transitions in CSS. In my opinion the best explanation that I found is at the Adobe website

patrick
  • 11,519
  • 8
  • 71
  • 80