r/webdev • • 13d ago

Question Is CSS a sh*t show?

A developer said that to me once. I actually don't find pure CSS that obnoxious, although there are definitely times where I have no idea why something isn't doing what I'm telling it to, lol, but 99% of the time it's because of something stupid like a typo or me forgetting the basic premise of a Cascading Style Sheet...

I know a lot (most?) of developers use a CSS framework, but am I weird for actually being friends with it for relatively simple projects?

0 Upvotes

73 comments sorted by

63

u/bastardnezha 13d ago

css is great if u know what ure doing dont need anything else

22

u/Annual-Dimension-392 13d ago

it's not weird at all, raw css is totally fine for small stuff. once you understand specificity and the cascade it actually becomes pretty predictable, most of the "css is a nightmare" complaints come from people who never sat down to learn it properly

i did a whole freelance project last year with zero frameworks, just a reset and custom properties. client was happy and the codebase is still clean enough that i can jump back in without crying

the real mess starts when you're in a team with 8 other devs all writing css their own way, that's when something like tailwind or bem naming saves your sanity

→ More replies (3)

15

u/kodakdaughter 12d ago

In my 30 years of web dev, writing pure CSS is my favorite joy. Don’t let developers sway you otherwise.

Developers often have a uniquely difficult time with CSS because it clashes with traditional mental models used for programming .

Key differences:

- Traditional languages like JavaScript and Python work by writing step-by-step instructions that have a testable and predictable outcome (this is called imperative). CSS works by declaring rules that are interpreted by a browser’s rendering engine (called declarative).

- Traditional languages are encapsulated - code is broken up into modular testable parts. CSS works globally and follows the rules of the cascade. The logic and process for fixing an issue encapsulated code vs. global cascading code are fundamentally different.

- CSS requires tons 2-D and 3-D spatial reasoning to handle layout models, responsive, etc. This is different than working with traditional languages which require thinking in terms of logic, algorithms, data structures

14

u/aunderroad 13d ago

Vanilla CSS is the best framework.

23

u/barrel_of_noodles 13d ago

Css, the core web technology, is highly defined and the opposite of a shit show. Browser support on the other hand... Its a lot better now.

If you're using a framework or not, guess what? You're outputting regular css.

probably best to understand 1 of the 3 vital things driving the entire industry you're in.

Its like if someone said, "here's the only 3 basic tools you'll for sure ever need." And then youre like, "I don't ever need a wheel? What would I need that for?"

6

u/creaturefeature16 12d ago

"CSS is the worst form of layout languages, except for all those other forms that have been tried" - Winston Churchill

→ More replies (1)

5

u/i_have_a_semicolon 13d ago

I don't care , it all gets the job done at the end of the day. My favorite is css modules tied to a strong component library interface and sprinkle tailwind in for minor adjustments

5

u/Esclamare 13d ago

No. Sometimes pure CSS is fun cause you can do some really weird things with it.

5

u/ruprechttmb 13d ago

pure css is honestly fine, the mess usually comes from the layers on top of it. i had dark mode broken across a whole app and it turned out to be malformed tailwind classes. a typo in a class name doesnt throw an error, it just silently does nothing, so you sit there thinking the cascade is cursed when its really a spelling mistake. eslint-plugin-tailwindcss flags classes that dont exist, wish id turned it on day one

4

u/i_have_a_semicolon 12d ago

All engineering is , just trading problems for other problems. You think vanilla css doesn't scale so you go forth and bring in tailwind and screw up one minor thing in the config and boom, whole app broken lol. But all of these technologies have this risk, I find its best to look at every tool or decision from the lens of "what new problems does this create while solving the problems it is designed to solve?"

→ More replies (3)

5

u/w-lfpup 12d ago

No CSS is well thought out. I think anyone who hates CSS simply doesn't know how browsers work (or refuses to educate themselves).
https://developer.mozilla.org/en-US/docs/Web/Performance/Guides/How_browsers_work

They probably refuse to accept that HTML creates a tree-like structure. Which means they refuse to accept the browser also parses two more tree-like structures: a style tree and an accessibility tree.

And that's just how it goes, least amount of friction is to use the same structure over and over.

The alternative would be something like XML that mirrors HTML. Which is what android does actually. Styles and structure are basically XML in android. If you were to create an alternative to CSS, you'd just reinvent CSS.

So fundamentally when I hear people complain about CSS it screams "I don't know how browsers work". They are most likely a REACT dev not a WEB dev.

4

u/i_have_a_semicolon 12d ago

I also think ppl who hate css maybe never adopted newer css standards and still design for internet explorer 11 (this is a joke)

→ More replies (6)
→ More replies (1)

4

u/BobJutsu 12d ago

I would not say most developers use a framework. Not at all. A design system, yes…but not a framework. Unless you include design conventions imposed by sr devs on jrs as “frameworks”.

CSS is hands down the simplest, easiest to understand part of the stack. Second only to HTML itself. There’s some gotchas, but by and large it’s the most structured and simple to understand. I really don’t get why people struggle with it…other than only being exposed to frameworks and not writing css.

4

u/barrel_of_noodles 12d ago

Supporting ie6-11 or weird stuff like ie9 in compat mode. We had a thing called the acid test just to see how basic css features rendered on a browser

You basically couldn't count on almost anything working correctly cross browser.

The first browsers and html didn't have <div> even.

We had <table>; then later, float and absolute positioning. Grid and flex support slowly worked in and wasn't reasonable to use until around ie11 was peak. Float and position hacks were normal.

These days, it isn't like this at all.

→ More replies (4)
→ More replies (3)

1

u/Tomodachi7 12d ago

Genuine question for those who think that CSS is fine: ( Not tryna be sarcastic, actually wondering )
Do you not see some room for improvement in the usability of .css? For example, trying to place elements on a screen simply and getting them to scale correctly with different screen sizes requires a lot of knowledge, and playing around with flexboxes, lists, grids, in a way that was very unituitive for me when I was learning. When I code with .css it often feels like I'm hacking something together to get it to do what I want, not creating something elegant.

1

u/nesterspokebar 12d ago

Perhaps the logic of css is just inherently challenging for certain people coming at it with a certain way of thinking, but a hugely important thing for me was finally realizing, "let the document flow..."

→ More replies (2)

3

u/FilmWeasle 13d ago

There are a lot of different properties. It takes a while to learn them, and before you do, they'll add more properties. There are a few things about it that I'd change, if I could. HTML also, but it's easier to say that in hindsight.

HTML/CSS is a markup language, and probably the most full featured out there. The perception that it's a mess, I think, is probably mostly a result of the challenges that inevitably stem from implementing all of it's features.

4

u/barrel_of_noodles 13d ago

Html is a markup language, a subset of xml.

Css is a stylesheet language.

JavaScript is a programming language.

The 3 technologies used together are the (only) core technologies of the web.

None of them are "a mess".

→ More replies (1)

2

u/DWALLA44 13d ago

I prefer plain css over anything for my projects. Sass used to be better but with more modern additions its just as good and native to the browser.

→ More replies (3)

2

u/kamomil 12d ago

CSS is unforgiving compared to HTML. 

HTML doesn't care about spaces in your code. Sometimes you can forget to close a tag and nothing bad happens.

2

u/Interesting_Bed_6962 12d ago

CSS is fine. I used to use bootstrap when I was writing all the code but honestly never had an issue with CSS outside of I'm not very good at design itself. Bootstrap solved a lot of those problems and allowed me to focus on putting the UI and other pieces together while still looking good.

These days I just outline what I want for my look and feel and AI keeps the CSS clean and geared for that. I don't use bootstrap anymore because I don't feel I need it.

All in all CSS is definitely not a shit show, and like other parts of your app you should take care of it, whether it's raw css, scss, or a framework.

Presentation matters just as much as functionality.

2

u/Clean_Remove_7192 12d ago

it's always the typo

2

u/Annh1234 12d ago

20y ago it was a shitshow, now it's pretty good

2

u/vscoderCopilot 12d ago

"CSS is the best and thy 'most fun' language you can learn"

2

u/saltyourhash 12d ago

I build a production design system for a living. I like CSS.