Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Shouldn't pure CSS animations have better performance?


CSS animations are generally on par with JavaScript, except when they're hardware accelerated.

But that's changing once web animations (https://w3c.github.io/web-animations/) hits mainstream anyway - both CSS & JS get access to the same engine.


The point of CSS animations isn't HW accel - you get that just from layerization. What it does get you is animations executing off the JS thread, so if you have piles of third party JS it won't cause frame drops.


Right, which you also get via the web animations API (queue up animations, and have them run on a separate thread)


Good point.

If you use Wordpress, like millions of people do, you will have a fuck ton of JS plugins running, so I can see where this would be advantageous.


If you have a sane amount of JS (ie, not loading entire libraries to accomplish an accordion) the performance differences should be negligible.


The animation, yes, but not the trigger. You can balance this by adding / removing classes in javascript (to limit the complexity in CSS) and with the class performing the animation.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: