What is LESS CSS? Hints and tips
blog.bugsense.com
blog.bugsense.com
When I first started using less I found the javascript parser missing some functionality that was in the full ruby gem. Also, since I use django, I found integrating with scss much easier, especially with pyscss.
I find that scss provides a level of abstraction that I am comfortable with. Because of pyscss I can run it from the command line and figure out exactly what is going on pretty easily.
With compass I find that I write much cleaner css code. But the big win is being able to nest my css. Nesting CSS brings it much closer to the HTML that you are styling.
In my mind this is the huge win.
body
color black
a
color @color
will compile to body{
color: black;
a{
color: black;
}
}+1 for Stylus.
"when it goes wrong, which it does regularly" requires more substance though; LESS or SCSS have never presented a real problem for designers or developers I've worked with. These are valuable tools that address a deficiency when crafting CSS, and should not be discredited so quickly.
What do you mean by "it goes wrong"? Do you mean the LESS parsing engine fails? Because I've used LESS extensively and it's never happened once. If you mean "my code was incorrect" then yes, LESS errors could be more descriptive. But it's hardly world-ending stuff.
I experienced utterly unhelpful parse errors resulting in head scratching for literally hours. Small behavioral changes between versions resulting in broken CSS. Zero error checking in the code whatsoever. Completely 100% incompatible with some browser hacks.
Each of those, plus the non-portable learning curve eats time and therefore cash resulting in a net loss versus plain CSS.
Shrug. I've never experienced the problems you mention so I can't say much, but using plain CSS seems like a huge time-waster after having used LESS extensively. It cuts down my CSS work dramatically.
And with the benefits it has brought, in terms of code intelligibility and structure, and lack of redundancy, I'm not sure I'm ever going back to pure CSS again.
I am literally baffled by your experience. What version changes created problems for you? And as for error checking, pure CSS has no error checking at all, so I don't understand how LESS could be anything but better in that regard.
As for using browser hacks with LESS, I've never tried, but since you can always include conditional stylesheets to account for browser differences, it doesn't seem like that should be a dealbreaker. It would be pretty cool if LESS supported inline browser detection per-rule, however.
Try Stylus. It has way better error reporting, and less broken stuff too. http://learnboost.github.com/stylus/
If you are working on a project of any size, a pre-compiler becomes essential.
And without all of the braces and semi-colons, nested selectors in Stylus become a really nice representation of the module your describing.
[edit] Well I guess the old repo did mention the switch :\ https://github.com/cloudhead/less still frustrating