Skip to main content Accessibility Feedback

Should JavaScript developers know CSS?

tl;dr: yes.

Yesterday, Eli Fitch tweeted:

Grinds my gears that CSS focused developers who are learning or sometimes struggle with JS are made to feel stupid, but when developers struggle with CSS it’s because CSS itself is backwards nonsense that should be burnt to the ground.

Which I gleefully retweeted with my own thoughts:

As a JS developer, I 100% agree. JS devs not knowing CSS is a big part of the reason why the web is such a clusterfuck right now.

And I mean it. The web is a big, bloated mess.

JavaScript is eating the web

We use JavaScript for everything, and a big part of the reason is because far too many JavaScript developers don’t know CSS or HTML fundamentals particularly well. When you’re a hammer, every problem looks like a nail.

Tom Feeley thoughtfully asked:

Where does the responsibility for knowing CSS lie? With designers? JS devs? Back-end? Or maybe it’s a straight-up markup role like @DockYard staffs … That’s part of the issue.

I think you can pretty clearly argue that backend developers wouldn’t necessarily be expected to know this (though some do).

So, who should know CSS?

The Front End Stack

I view the front end stack as a progression: HTML → CSS → JS.

They should be learned and used in that order. So… if you write JavaScript but don’t know CSS, I don’t trust you to write good JS.

What I mean by that is: you may be a very competent JavaScript developer, but if you don’t understand how CSS works, your ability to write performant, scalable JavaScript goes way down.

And you’ll probably end up using JavaScript for things better suited for CSS.

You don’t need to be an expert at CSS, but I know far too many JavaScript developer who either don’t know what it all, or are terrible at the basics. They think the cascade, for example is a bug, and not a feature.

Knowning CSS makes you better at JS

Learning the fundamentals of HTML and CSS will make you a better JavaScript developer.

You’ll approach your code differently. You’ll think about the web differently. You’ll empathize with your users, designers, and UX engineers more deeply and meaningfully.

Who should learn CSS? Anyone who builds for the web.