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

Could someone who uses less regularly lay out the advantages over vanilla css? I see nesting and vender-prefix normalizing, but to me those are pretty small gains. I'm sure I'm missing something.



You. Will. Never. Go. Back.

I mean...variables? Do you never have the same width in two places? That is so simple and so huge. Want to make your shade of green 5% darker? Don't look up a new hexadecimal, just say darken(green,5%).

Make a button "class" where the only input is a color, and it automatically generates a cross-browser rounded-corner button with a slight gradient to 10% darker color, 20% darker border, with 20% lighter inset box shadow.

Really. You will not go back.


Once you start using mixins, you'll never go back. Add a clearfix, IE hack or a cross-browser CSS3 property at the drop of a hat, over and over again.

I also find that just due to the nature of the nesting, I'm writing much tidier CSS as a result.


Nesting itself is worth it's weight in gold. Add in mixins, variables, etc and it's just icing on the cake.

I also force myself to add hover states to all the links, even if the client didn't specify it in the designs. Being able to use something like:

@link_color: #ffcc66; @link_hover: darken(@link_color, 15%);

is a HUGE perk.


Also, it makes it super easy to hit the CSS rules-per-file limit that Internet Explorer has.


http://lesscss.org/

don't think it touches vendor prefixes.


I think you're right that it doesn't have built-in simplification of vendor prefixes, but they are trivial to implement into mix-ins (the example on the page you linked shows how), and I suspect it's one of the first things people set up when starting with LESS




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: