Hacker News new | ask | show | jobs
by coldtea 4838 days ago
>Given I don't understand SASS and Less, you seem to have, in each case, replaced some CSS with something which is longer, and less easy to understand.

You could say the same objections to anything you don't know. CSS, HTML, JS whatever.

When you try to use it and understand it you will see why its useful. Or, if you still don't find it useful, you will at least have a reason, besides "I don't know it".

I assure it they are very useful. I use LESS.

You can use as little or as much of LESS as you want. A valid CSS file is also valid LESS (just uses 0% of it's features). You can start using some features as you learn it.

For a simple example, in order not to repeat 100 times a color, you can save it as a variable:

@main_color: #ddd;

then you can use it in rules like this:

blockquote { color: @main_color; }

.logo { border: 1px solid @main_color; }

So changing all the colors in a site it's as easy as changing ONE line, not hunting for #ddd; everywhere.

Basically, LESS is to a CSS file, what a CSS file is to setting things directly on the style attribute of each element.

You wouldn't style each element directly on the page, right? You'd use a referenced CSS stylesheet. Well, for the same --or very similar-- reasons, I wouldn't use a mere CSS file anymore.