News for hackers. Stuff that matters.
Re:Less.js will obsolete CSS by edanm on Sunday June 20, 2010 @06:26AM (#1446252)
Let me give an example use case, something I've wanted.

Lots of developers will tell you that it's fine to use systems like the 960 Grid System for rapid prototyping, but you shouldn't use them for final, "production" sites. Their argument is that "littering" your code with classes like "grid_4", etc. is not semantic (and they're right).

So here's what I would love to do: use a system like 960 in development, but instead of using names like "grid_4", use actual, semantic names. But behind the scenes, I'll use less to "inherit" the grid_4 properties into the semantic name.

E.g., assuming I have: "<div class="grid_4 article_header>", I'll remove grid_4, but use less to make "article_header" inherit grid_4's properties. That way my html remains semantic, but I get the full power of systems like 960.gs.

Re:Less.js will obsolete CSS by isleyaardvark on Sunday June 20, 2010 @09:47AM (#1446449)
I'll give another example with mixins: clearfix. I've seen webpages littered with class="clearfix" all over the HTML. That doesn't do anybody any good. With a CSS preprocessor you can define a clearfix mixin and just write it something like:

.class-name .clearfix font-size: 1.2em

There are other ways to do it like one long string of selectors followed by the clearfix code, but they're not as convenient or readable.

Re:Less.js will obsolete CSS by mhd on Sunday June 20, 2010 @04:15PM (#1447102)
Isn't that basically what compass does?

http://compass-style.org/