←back to thread

451 points todsacerdoti | 4 comments | | HN request time: 0.658s | source
Show context
b_e_n_t_o_n ◴[] No.45060146[source]
I really do appreciate the nesting they've added but looking at it as a whole, CSS is a really strange and in my humble opinion, a terrible language. Perhaps I'm just holding it wrong, but it's just so complicated and messy, it sometimes feels like you're just arranging arcane runes in different ways until you make it sort of work for you. It's both a system for styling text based on inheritance, and a layout system for block and inline elements, nested recursively but without inheritance, only containment. I think it was a mistake to combine styling and layout, and I don't feel like adding more and more capabilities to something fundamentally broken can fix it.
replies(11): >>45060383 #>>45060483 #>>45060957 #>>45061557 #>>45061852 #>>45062092 #>>45062151 #>>45062384 #>>45063859 #>>45067840 #>>45069507 #
tmpfs ◴[] No.45062384[source]
I disagree, I think most of these opinions I see about CSS are from people that haven't taken the time to learn it and particularly to understand the cascade.

Many years ago I did a very deep dive into the CSS specs as I was researching for a new implementation and it struck me as well designed for its purpose of separating style from the semantics of markup.

replies(6): >>45062607 #>>45062813 #>>45067326 #>>45067564 #>>45067844 #>>45068108 #
1. sensanaty ◴[] No.45067564[source]
IMO the cascade is the exact problem with CSS. It worked fine when all it was dealing with was super simple documents with a few rules here and there, as soon as we started making applications the cascade causes endless headaches, and most modern methods of handling CSS like modules or libraries like Tailwind are made specifically to avoid cascade/specificity issues. Conceptually CSS is not really all that complicated, but in practice when you have dozens or even hundreds of CSS files for an entire app, it simply becomes a herculean nightmare to deal with and to wrap your head around.
replies(1): >>45068429 #
2. reaperducer ◴[] No.45068429[source]
As someone who works with many dozens of CSS files each day, I can say the problem isn't CSS. It's devs who are too lazy to document their work.

If everyone is working from the same spec/reference, it's fine, and you get consistent, reliable results.

When devs have to stumble around in the dark and end up reinventing the wheel every few months, that's when things go badly.

replies(2): >>45068989 #>>45069002 #
3. typpilol ◴[] No.45068989[source]
When the !important comes out it's all over
4. marcosdumay ◴[] No.45069002[source]
> devs who are too lazy to document their work

That's as bad a complaint as the one about cascading.

Your rules should be close to the object that uses them. It's really bad that CSS only supports global rules, and that is not a fault of the developers writing those rules.