DEV Community

Cover image for Why is CSS Hated On?
Gabriel Pedroza
Gabriel Pedroza

Posted on

Why is CSS Hated On?

I've seen a lot of posts about people despising css but I don't truly understand why. Is it the lack of foundation? Is it the specificity or the abundance of properties? If you guys want, I can create a multi-part series of CSS starting from the absolute basics to the advanced properties of CSS or I can create a huge cheat sheet on it for an easy bookmark. Let me know what you think of CSS in the comments and should I create an in-depth post or cheat sheet about it?

Latest comments (33)

Collapse
 
techthatconnect profile image
TechThatConnect

Css is great. I love learning how to do stuff I previously thought I needed javascript for with just css/html. I just recently wrote a post about the history of the css if anyone is interested.

Collapse
 
latobibor profile image
András Tóth • Edited

In my own very subjective experience CSS gets a lot of roasting because of its early days. In the early 2000s there were many browser engines with half-baked implementation of the standards.

You built up your site in Internet Explorer 6? How cute 🤩. Now it looks like crap in Firefox... One browser had default margins and paddings, the other didn't, things that were not exactly specified by the standards (like negative margin values) got implemented in widely different ways and so on.

With the unreliability of the effects of the declarations, it soon became a running joke to struggle with CSS, and people often felt it is witchcraft instead of engineering. Witchcraft in the sense that you have to inherit a recipe for a concoction from somebody as you have no chance figuring it out yourself: "Well, you know, what you wrote is OK in this browser but now just copy-paste this block to make it work in everything else."

Though language itself was mostly logical (there are still issues coming from the huge vocabulary you need to learn), but its support was not; you had to learn a ton of non-reusable workarounds, that made it unpopular. (I wrote about non-reusable knowledge: it is a must to be an effective engineer, but you hate gaining every bit of that knowledge...)

That was one source of unpopularity. The another one was a missing dimension of freedom. CSS was intended to describe documents in an effective, overridable way: with a couple of great rules you could style a huge amount of documents with very little code.

But the same thing did not work when you had multiple teams working in a big application. When one team had its implemented its own notification-dot and then another team their own notification-dot declarations, the resulting conflict meant that things were breaking without warning. The language itself did not have a trivial, explicit way to express isolation from other's code (with the advent of CSS layers, we might have this ability).

And in a big corporation isolation is important thing as people does not have the time to ask every team's every developer if it OK, that they will have a .notification-dot class.

Then people started "fixing" CSS by inventing abominations that went against the nature of cascade and caching, like forcing CSS to be created during JS runtime to be tightly linked to the one component it was used for. This essentially robbed the browser engine to effectively cache stylesheets and speed up rendering.

But in 2022 the standard got adopted pretty well, most browser engines are gone and there are very good training materials. So it is time to embrace the cascade and write smart, fluid designs. (Tip: Every Layout -> one of my favorite new sources).

Collapse
 
johannes5 profile image
Johannes5

I just despise having to open a document and change some values (and sometimes even having to refresh the page) before seeing a result. That's like making Typewriter art.

Don't blame a designer wanting to create components in a design tool, where he can drag, resize and otherwise use interfaces that represent the desired behaviour better than a bunch of css keys that have to coexist in the right way (with multiple gotchas to look out for).

Luckily, there is a tool called Plasmic.app which not only generates components for, but keeps their design (in Plasmic Studio) in sync with your codebase. And also allows you to "register" pre-existing components to configure them in Plasmic or insert public components like Antd. And you can directly feed components with content from your CMS without having to touch code at all.
And if you decide using their "Codegen" option (React only), you have little to be desired in terms of customisability. Your own, let's say "Modal" component, wraps a "PlasmicModal" component. Which you wont touch directly(because it will be overwritten), but you can manipulate its elements and variants and slots(content) via props.

Collapse
 
ianhobbs profile image
ian hobbs

Neither. There are great resources for learning CSS out there, books blogs posts. I was thinking recently that working effectively with CSS is to work with 'knowing' browser behavior. Knowing the cycles of load, layout, paint. delay etc. We are wrestling with multiple vendor approaches to visualizing content and that is often seen as a kind of war with all kinds of forces. Network speeds, loading sequence, display resolution etc. It's messy and complex and the css rules are "advisory" or hints for the browser.

I suspect that some coders like dry and hard guaranteed outcomes of their code. CSS lives in a messy world of drama and negotiation of forces outside the code.

I think a stick-man cartoon of CSS vs browser might be a better investment of time. :)

Collapse
 
bmassioui profile image
Bouchaib MASSIOUI

I could say that the most of them are surly Software Developer which is normal to despising CSS in my opinion (am one of them ...:) ), they are mostly mastering all what about the Business Logic and nothing else. They love consuming existing UI component for front instead of understanding what each color refers to unlike Website developer they are familiar with building a design from scratch .... like using bootstrap, Semantic UI ...

Collapse
 
diballesteros profile image
Diego (Relatable Code)

Fear of the unknown. Like almost everything in life it has its quirks. But theres a pattern to everything. Its just about dedicating time to learn how it works and then the hate will go away.

Collapse
 
hacker4world profile image
hacker4world

Css seems very low level, you have to modify the smallest things to make something look good that's why you see frameworks trying to simplify the process

Collapse
 
marinsborg profile image
Marinsborg.com

I don't hate it, I just did not bother to learn it well as a backend developer. Also, there are so many screen sizes that you need to support today.
However, I like to see what other people do with it and I like people's creativity.

Collapse
 
shigetorum profile image
Edge

Most of the "hate" comes from people with lack fo experience in it, its easy to get frustrated in CSS.

But anyone who has some level of knowledge (not necesarily expertise) will tell you that CSS is purely logical. Most of it is made to make sense, and for small caveats, there's SASS, SCSS...

It's not really hate, just frustration.

Collapse
 
edindevto profile image
Ed is Taking Note • Edited

I love CSS ,and I think we should not consider CSS to be a programming language. CSS has nothing to do with programming. It's more like rules of settings. We may break the rules if we don't understand it enough. I heard people hate CSS simply because they don't thoroughly understand, and it's very likely that they may build some crazy things with wrong ways.
Unlike programming languages that keep changing a lot every year, once we know CSS rules, we can just follow it to do lots of things for years. It really pays off to fully understand CSS details, and that's why I love CSS.

Collapse
 
atulcodex profile image
🚩 Atul Prajapati 🇮🇳

I still love CSS

Collapse
 
leob profile image
leob

They find it hard, and "hate" (or dislike, or whatever) is people's emotional reaction to the fact they find it hard and are unable to wrap their head around it.

There was another post about this subject, I added a comment there that might be relevant: dev.to/leob/comment/1p0gp

Collapse
 
jenueldev profile image
Jenuel Oras Ganawed

but I believe their are more people who love CSS. Unless if we talking about work flow, specially comparing css, scss, sass, tailwind, windicss.

Collapse
 
eljayadobe profile image
Eljay-Adobe

CSS is fabulous, and powerful.

Haters gonna hate.

Collapse
 
abbeyperini profile image
Abbey Perini