3
nirvan
8y

Challenge of every front-end developer: Should I do I with CSS or JS?

Comments
  • 8
    if it's something you can do with both, choose css
  • 2
    A valid question!

    I was recently called on to debug a website that was making chrome consume 70% CPU on a particular page.

    My first instinct was it should be a JS issue - perhaps a loop that's not ending. So I turned off JavaScript in the dev tools and to my surprise, the CPU utilization was still hovering at around 65%.

    I then proceeded to profile the page with JS still disabled and found that the page was redrawing itself continuously. The reason for that was a loader animation implemented in CSS using keyframes instead of using a gif. Ugh!
Add Comment