DEV Community

Cover image for Is CSS dying already?

Is CSS dying already?

Adnan Babakan (he/him) on May 17, 2020

Hey there DEV.to community! Recently I was thinking about how much I used to use CSS and nowadays I don't. Don't get me wrong, CSS is still runnin...
Collapse
 
ben profile image
Ben Halpern

If CSS is dying at the hands of preprocessors and becoming more like an assembly language, I wouldn’t characterize that as dying, just maybe serving a different purpose.

But I’d also say that CSS is actually adopting features of preprocessors gradually and offering more and more natively, so it’s also pleasantly evolving.

Given how useful it is to whip out a <style> tag and write some plain old css, I’d say css is living on in several quite useful ways.

Collapse
 
hendrul profile image
Raul Contreras • Edited

You say old, that's what it is nowadays, an old rusty way of doing styling, it's just to hard for the masses to digest the new approach that's actually taking shape... style components and properties, using the same language, instead of trying to keep alive that crazy tech from the past.

PD. I hate CSS, its just ugly and messy, and dificult to visualize on your head separated from the structure

Collapse
 
adnanbabakan profile image
Adnan Babakan (he/him)

Well. Actually, CSS is really good. My aim in this article was telling that CSS is going to run in the background for so long, but what developers are going to use on the surface are other tools like SASS or React Styles. I suggest you start liking CSS. It is pretty awesome!

Thread Thread
 
hendrul profile image
Raul Contreras • Edited

I agree with css being a low level, powerful, ultimate, but last resource to do styling. Today's component frameworks like React has change the way you build user interfaces, and plain css or scss with post processors are not the best match for components. There are new and better ways like combining the power of utility classes with all the benefits you gain with css-in-js. A tool like twing.macro allow you to perfectly mix the beautiful tailwindcss utility classes, with styled-components, emotion, or goober. With these you can open a whole new means to style fast and efficiently.

My point is, in my projects I always try to write as few plain, repetitive css as posible, I really prefer using tailwindcss paired with css-in-js paradigm that allows me to organize much better and choose the best alternative for each case.

Collapse
 
steveblue profile image
Stephen Belovarich • Edited

Learn CSS and embrace it. Don't just wish that someday it will disappear so you don't have to think about it anymore. That future won't happen for the same reason a website from 1998 still works today.

Collapse
 
hendrul profile image
Raul Contreras

It's happening flutter.dev/

Collapse
 
kailyons profile image
Loralighte

My stance on CSS dying is that it has a lot of time before it should worry about that, but it is something that might happen in the next 10 years.

Possible but in mu opinion unlikely.

Collapse
 
sefrem profile image
sefrem

For a rather custom project you would spend more time customizing the default look of some components lib rather than you'd spend just building everything from scratch. Haven't tried Tailwind so far though, added it recently to my learning list. I think it is the future - no- or little-opinionated highly customizable components. But you still need to know what's under the hood to customize properly. So no, css is not going anywhere.

Collapse
 
dkruythoff profile image
Darius Kruythoff

Sounds as dead as Javascript to me, since I once had to get used to compiling my JS.

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

I'm reading comments like this since to good old days of CoffeeScript :D
And still, JS is going strong ;)

Collapse
 
dkruythoff profile image
Darius Kruythoff

Exactly. And so is CSS, despite people not understanding it or not caring to try.

Thread Thread
 
lampewebdev profile image
Michael "lampe" Lazarski

People, in general, are learning frameworks or abstractions
and when they have to write js or CSS are complaining on the internet

This is why I advocate for learning the basics first.
Because what usually dies first are the abstractions and frameworks like CoffeScript just to name one example.

Collapse
 
aditdamodaran profile image
adit • Edited

You characterize shortcuts for common tasks as "killing" CSS, which I think is a bit misguided. Your use (or lack of use) of any tool is context dependent. And my two cents are that knowing the vanilla language enables you to discriminately and appropriately apply frameworks (which you see right now with Javascript).

A better headline for this article might be "Given more libraries and frameworks, some developers (probably beginners) are spending less time learning the intricacies of Vanilla CSS."

Collapse
 
dimaip profile image
Dmitri Pisarev 🇷🇺

A lot of us go for inline styles with CSS-in-JS like Emotion. To my taste that's the most viable approach so far. So yes, cascading feature of CSS seems to be dying, all other stuff? -- Don't think so.

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

ahh a lot of assumptions here.
Which looks like a filter bubble to me.

For example yes Tailwind is popular.
Does it replace every other CSS framework? No, not at all.
If you look at websites running then probably bootstrap is still king.

CSS can do a lot of things in a modern browser where you don't need to use a preprocessor.
and what does that preprocessor output in the end? CSS right :D

Oh yeah, the inline CSS argument. This will die earlier when CSS itself.

If you just pick a theme and a framework then yeah you never have to touch CSS.
But if you just work at a bigger project with more custom elements then you have to understand the framework and how to extend that CSS correctly ;)

Just because in tutorials and youtube and twitter talk a lot about things it does not mean that it reflects the reality in software projects.

So yeah to anyone who made it that far:
Learn CSS
Learn Javascript
In general, learn the basics if you want to become good.
If you just learn the frameworks then you are outdated in the next 3 to 4 years.

Collapse
 
easrng profile image
easrng

I use CSS still, and don't find preprocessors necessary. CSS already has variables, and I like it's syntax just fine the way it is. I think, as a standard, and in terms of usefulness, it is growing.

Collapse
 
hendrul profile image
Raul Contreras

Vanilla CSS is terrible, low level, inheritance, a language on its own to give style, out of the context of where the real thing is happening (javascript), static, repetitive, I can only guess that you like it because you haven't understand other approaches. CSS will forever be the styling way for browsers, but will become a low level thing. Just look at flutter, try it, and we'll talk then

Collapse
 
easrng profile image
easrng

I have tried flutter, and I did not like it. It is an inaccessible mess, and it needs a build step.
If your main site content is JS, you are doing it wrong. Progressive enhancement is the way to go, never rely on any one component. No JS but have CSS? Great. It should work. JS and no CSS? Working too. CSS and JS but missing things like ES modules or CSS Variables? Let them use the noscript version. Inheritance is powerful and useful, and so is the cascade. I suggest you use CSS more, it takes time to get used to, but it is well worth it. Also, never write all your CSS by hand. Use the browser devtools, you can see changes live and in Chrome at least it has extras like a nice color picker, the shadow editor, and the timing-function editor. JS styling was tried before at Netscape, and it failed miserably. If you do not learn history, you are forever doomed to repeat it.

Thread Thread
 
hendrul profile image
Raul Contreras • Edited

You can do everything with css, but today there are better ways to apply css, like tailwindcss in combination with twin.macro and css-in-js. Have you tried tailwind?, it's not the same as bootstrap, it's focus is utility classes. Just using their playground you should see the huge difference to reinventing your own class names every time and repetition everywhere. I mean, css is going to be there always because it's pretty powerful, but there are higher level alternatives that are a boost for productivity without the having to pay with efficiency.

Thread Thread
 
easrng profile image
easrng

I don't like utility classes. If someone made something like tailwind but using css variables instead of classes, I'd jump on in an instant, if it had any benefits over vanilla. I like my content and styles seperate.

Thread Thread
 
hendrul profile image
Raul Contreras

With css in js everything is possible, you want separate styles? It got’s you cover, you have alternatives so you can lower the level when you need to, or use utility classes on other cases. Its definitely a matter of taste. I prefer styled components, css in jsx as properties, or tailwind

Thread Thread
 
easrng profile image
easrng

CSS in JS cannot style elements when JS is off, or in browsers without JS.

Collapse
 
adnanbabakan profile image
Adnan Babakan (he/him)

CSS is growing and that is awesome. Especially the latest updates which added variables. But preprocessors are still powerful, especially when it comes to the nested selectors.

Collapse
 
hendrul profile image
Raul Contreras

I couldn't be more agree with you... In the past you hadn't other choice but css, keeping style and structure apart is at all a nice thing, today there are still some advocates to css, but this retrogades are going down... just look at flutter!, it is completely the future in styling... style components and style properties, and composition over fucking inherintance

Collapse
 
codingmindfully profile image
Daragh Byrne

If you still have to debug it, it isn't dead.

Collapse
 
adnanbabakan profile image
Adnan Babakan (he/him)

Hahaha, good answer.

Collapse
 
mehdico profile image
Mehdi Mousavi

No, but I hate it.

Collapse
 
adnanbabakan profile image
Adnan Babakan (he/him)

Chera? LOL

Collapse
 
atajjj profile image
AtaJJJ

Hello Adnan,my friend So what do you suggest instead of css?

Collapse
 
adnanbabakan profile image
Adnan Babakan (he/him)

Hey there mate
There is nothing to replace CSS behind the scene. I mean we are using frameworks already. I really love Vuetify and hardly get into CSS unless wanted to create something special. Vuetify gives the power to control the CSS attributes in JavaScript or as component attributes.

Collapse
 
meatboy profile image
Meat Boy • Edited

IMO CSS isn't dying, but it's continuously going toward current pre-processors. Current CSS can do some basic calculations and handle variables similarly to SASS or LESS.

Collapse
 
abodmicheal profile image
Abod Micheal (he/him)

Yea it is but it's not going anywhere, they're gonna get right up with few updates, actually we all still need CSS

Collapse
 
orhanozkercin profile image
Orhan Özkerçin

It's quite instructive article for people which is new in web programming like me. Good job 👌👍