Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Better or Worse: Styling with JavaScript vs CSS [closed]

Tags:

I'm working on a responsive design would like to know if it is better to style an element using JavaScript or with CSS? CSS is certainly easier to maintain, I won't argue that, but I'm a lot more comfortable building an object in JavaScript. Maybe I'm making more work for myself than I should, but I feel like I have more control overall and I like being able to hook into every object on the screen.

I have constructors that generate the entire page layout and push it into the DOM. No images, just pure JavaScript styling and SVG icons.

What I would like to know is:

  • What performs better?
  • What, if any hardware support is there for JS or CSS?
  • Is a pure JavaScript solution better than using CSS Calc()?
  • What's more portable?
  • What's more forward compatible?

I tend to avoid jQuery as I'm more interested in learning what makes things work right now, so pure JavaScript and CSS3 only, please.