Hacker News new | past | comments | ask | show | jobs | submit login

Most of the time when I see people complain about CSS it's because either they don't know how CSS works, or they want it to do something it wasn't designed to do in the first place.

Most of the time it's because they don't know how it works.

Lack of ability to nest rules in CSS makes it harder to organize styles. Not being able to create mixins and such makes all too easy to have to copy-paste and memorize cross-browser solutions & vendor specific rules for certain browsers.

In short, there is a lot of inefficiency with the current system that preprocessors help alleviate.

They truthfully do help alleviate such things, but none of this is impossible nor too terribly difficult to handle with plain old CSS.

Oddly enough, I've seen a number of people recently complaining about nesting in SASS claiming it creates problems. You just can't make everybody happy.

Simply indent child rules one step to the right. This even allow you to use code folding to easily see what goes with what.

Minify the code before it goes into production and you are ready to go.

Why do you need to nest things? The 'C' in CSS stands for 'cascading'.

Don't fear the cascade!

Well, it does clean up the code a bit, depending on your point of view. But it wouldn't necessarily interfere with cascade.

It's just right now, because CSS doesn't support it, that SASS code gets compiled into large selectors if you aren't careful.

It helps a little in the code organization, however, it creates new problems.

It makes deep nested code hard or impossible to reuse. It tightly couples style and markup, so a change in the latter can break the former, etc.

So while it is a nice feature to have, I'd recommend using it scarcely and with great care.

That's not a problem, that's not understanding how it works.

Any nested SCSS is impossible to reuse outside of its parent scope. If someone is using nested SCSS and expecting to reuse that code elsewhere then they are doing it wrong. It's the same problem that exists if one were to create a class as a child of an ID and then expect to use that class outside of the ID's scope.

Who needs code organization when Inspect Element gives you the filename and line-number, and all editors have Control-F :)

You can edit minified code if you've had enough coffee!

If you frequently see people not knowing how CSS works, then that could be a sign that CSS is fundamentally broken, over engineered, etc for what it does...

(rather than those devs being "stupid", "ignorant", "incompetent" etc).

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact