321 Views
Despite what many developers believe, CSS-based animation is not the only performant way to animate on the web. There’s also JavaScript—and JS has some incredible advantages. By abandoning JavaScript for CSS, like many developers do, we are bloating our stylesheets, sacrificing animation timing control, and forgoing physics-based motion. Don’t get me wrong. CSS animations play an important role on the web -- both in isolation and in combination with JavaScript animations. In particular, CSS is perfect for simple animations pertaining to basic user interactions, such as hover and focus states. JavaScript, however, is usually the better option for almost everything else since it’s much more versatile.