Changing some CSS attribute will trigger the browser to synchronously calculate the style and layout, which is a bad thing when you need to animate at 60fps.

DON’T

Animate with left and top trigger layout.

#box {
  left: 0;
  top: 0;
  transition: left 0.5s, top 0.5s;
  position: absolute;
  width: 50px;
  height: 50px;
  background-color: gray;
}

#box.active {
  left: 100px;
  top: 100px;
}

Demo took 11.7ms for rendering, 9.8ms for painting

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/96829371-f4de-4cee-b4ea-47a9bd91f9c2/Untitled.png

DO

Animate with transform with the same animation.

#box {
  left: 0;
  top: 0;
  position: absolute;
  width: 50px;
  height: 50px;
  background-color: gray;

  transition: transform 0.5s;
  transform: translate3d(0, 0, 0);
}

#box.active {
  transform: translate3d(100px, 100px, 0);
}

Demo same animation, took 1.3ms for rendering, 2.0ms for painting.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/23666fc5-6d5b-4579-bb7c-5df5c8a92b13/Untitled.png