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

For me, the killer argument has always been cases like this:

   a.btn {
   &-primary,
   &-info,
   &-success,
   &-warning,
   &-danger {
   		&, &:link { color: #fff; }
   	}
   }
Where the & is replaced with the previous mark, so it would create a.btn-primary, a.btn-info. You might still argue that you could get close to the amount of characters with vanilla CSS, but as soon as you have to change small bits of this, you end up refactoring a lot of code.

With LESS and SASS, you have a built-in capability to refactor things very quickly.




I'm now going to state something really stupid.

In none of aaronbrethorst's examples were multiple terms put inside a single pair of { }. Now I can see the advantage, as (obviously) when writing CSS it is common to have a lot of repetition of the type this lets you reduce.

Now, I can see the purpose of LESS and SASS. Sometimes when explaining something to someone, the most useful feature can seem so obvious as to not need explaining.


That's because manually indenting text in HN's commenting field is a tedious, error-prone process, and I am a profoundly lazy person. ;)


If you use Firefox, I highly recommend ItsAllText. It lets me right click on a textarea and open the contents with my editor of choice. When I save the file, whatever I wrote is automatically copied back over to the textarea.

Bulk indentation is one of the main reasons I switch over to vim for editing web text.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

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

Search: