Skip to main content Accessibility Feedback

Should JavaScript developers know CSS?

In response to my recent series of articles on how much Tailwind sucks, and how I generally prefer boilerplates over frameworks in general, one of the more common responses I got is that there’s simply too much for any one front-end developer to know.

The argument is that it’s unreasonable for someone to specialize deeply in JavaScript, and CSS, and web security, and so on.

And I agree!

Front-end web developer is simply too vast a discipline to know how everything works. This is why I generally think the notion of a full stack engineer is a myth. Often, it means you’re good at one aspect of web development, and passable at others.

But there’s a few caveats here.

I don’t expect deep JavaScript experts to also be masters of CSS. But I do think they should understand the fundamentals of how it works.

For example, a lot of Tailwind fans are React developers, and they often view the Cascade as a bug. But it’s a feature, deliberately built into the platform to reduce the amount of repeated CSS you have to write!

It’s literally what the C in CSS stands for.

A lot of what I see JavaScript used for in my client work can be replaced with one or two lines of CSS or a native HTML element.

I don’t think JS devs need to be expert CSS developers, but I do think they’d write much better code overall if they understand how it works and when it’s a better choice than JavaScript.

And if your JavaScript developers can’t write CSS without a library, maybe they shouldn’t be writing your CSS. Maybe you should also invest in CSS experts who aren’t necessarily experts at JavaScript.

And if that sounds absurd to you, maybe ask yourself why you’d be ok with JS devs who don’t know CSS but not the other way around.