3 ms·
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 gai
by MatthewPhillips 15y ago
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.
- helipad 15y agoOnce 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.
- dmvaldman 15y agoYou. 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.
- gerggerg 15y agohttp://lesscss.org/ http://lesscss.org/ don't think it touches vendor prefixes.
- CognitiveLens 15y agoI 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
- envex 15y agoNesting 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.
- siegecraft 15y agoAlso, it makes it super easy to hit the CSS rules-per-file limit that Internet Explorer has.