1. 5
    1. 4

      Please don’t do this: Animations that never happen still waste electricity, which harms the environment, and reduces browser battery time.

      You can use a CSS animation on a desired property and hook the animation events so your code only runs when something happens instead of every single frame.

      1. 1

        In a tweet op has linked on the main post they say that there is no perceivable performance degradation - I’m curious if you mean something else?

        1. 1

          Of course I mean something else. Where did I speak of “performance”?

          All that statement means is that JavaScript can query a property on every node in a set of a dozen or so sixty times a second on multi-gigahertz machines.