Hopefully you read my previous post about Sass and CSS preprocessors and felt my angst toward learning a new syntax. I've been using LessCSS for about a week and I'm really impressed. For starters, no new syntax to learn. This is simply an augmentation of existing CSS syntax. You get mixins, nested rules, and most importantly, variables. You also get operations but I've yet to find them that useful. Here's my critique:
1) Nested rules are so natural. CSS should have worked like this all along:
a { color: #ddd; :hover { color: #999; } }
2) Compile time is pretty slow compared to Sass. This kinda sucks when you're in a flow, needing to see a change and having to wait 4-5 seconds for the new file. If you install the TextMate bundle it'll automatically compile on save which is handy.
3) Variables are worth every penny:
@borders: #ddd;
div { border: 1px solid @borders; }
That said, I wish they had taken into consideration David Hyatt and Daniel Glazman's CSS Variable proposal since it's probably the closest thing to future reality.
4) There doesn't seem to be a way to access variables across imported stylesheets. I ended up importing a variables file on every page and my compressor removes the redundant generated styles but this is a temporary hack that I hope gets fixed.
5) Less really needs a decent TextMate syntax highlighter. I'm hoping to set aside some time this weekend to see if I can contribute to this.
6) While I would love to say border-radius: 4px; and have it compile with the -webkit, and -moz equivalent, the syntax enables enough abstraction so you can create the following mixin:
.border-radius (@radius=4px) {
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
border-radius: @radius;
}
div { .border-radius(8px); }
Conclusion
This is the most intuitive preprocessor I've found. The syntax additions fit right in with native language and teaching it is a breeze. If you get the itch to contribute head on over to the Github
Related tags: css, lesscss, preprocessors, style sheets
Comments
Alex Gaynor http://lazypython.blogspot.com/
Several of your criticisms of Sass weren't specific to it, but to any preprocessor. In light of those do you think you'll actually use LessCSS, or do you merely think the ideas in it should be pursued as a part of the CSS standard?
Nathan Borror http://nathanborror.com/
I'm using it for the next release of Readernaut. I like the workflow and syntax a lot but I really hope the compile time speeds up.
Daniel
Nathan wondering if you have looked at Anthony Shorts CSSScaffold for this type of thing. PHP5 is required so might not fit your needs but it sure seems comprehensive. A few links for you: http://anthonyshort.com.au/scaffold/ http://wiki.github.com/anthonyshort/csscaffold
Jon Buda http://jonbuda.com/
Agreed. I've been loving Less for the past several months. Definitely my only big gripe is the compile time, especially for large files. Also, if you end up having deeply nested selectors, it's rather easy to lose context. But overall it's certainly well worth it.
Jeff Croft http://jeffcroft.com/
Less's syntax, and the fact that it works with standard CSS files, definitely makes it more appealing to me than Sass. Still not sure I'm ready to integrate one of these into my workflow, but if I had to choose one at the moment, I'd go with Less. It just feels more targeted at CSS-heads instead of at hardcore programmers.
Chris Eppstein http://chriseppstein.github.com/
I'm glad that Alexis changed his mind about adding arguments to mixins. He was initially opposed to the idea, but they are such a nice way of abstracting away implementation details. However, from a syntax perspective I would have preferred the following:
This syntax is much more in line with existing css parsing rules and is going to work better with existing tools. Notice also that arguments to mixins are passed as key-value pairs instead of just values. I think this makes the code much more understandable to the casual reader who doesn't quite understand what the mixin does and it also eliminates the need to remember the argument order and to only pass some of the default arguments.
Notice also that I am using $ to denote variables instead of @ which is used to denote directives. I think $ is a much more intuitive syntax addition to non-rubyists since it is used in perl and php and is less likely to create forward compatibility issues as the CSS specification changes.
Lastly, note that a mixin is mixed by using + instead of ".". This is because that syntax implies class inheritance instead of just adding in the contents. I discuss the concept of class inheritance in great detail here: http://chriseppstein.github.com/blog/2009/10/12/css-class...
Nathan Borror http://nathanborror.com/
@Chris I don't mind the mixin syntax. I like its simplicity. Keyword arguments would be really nice. Using the example in the post, something like:
Chris Eppstein http://chriseppstein.github.com/
@Nathan
I did some testing on IE6 and found that the parenthesis fail more gracefully than the curly braces (even tho they shouldn't according to the css2.1 specification).
The use of curly braces with the mixin cause the parsing for the rules of the div selector to halt while the any rules following the parenthesis form are interpreted by ie6.
However, IE6 treated "." and "+" the same, and as such, I vastly prefer + because it avoids confusion with class inheritance which mixins are not. Also, there's no need for an @ sign in the argument passing.
Josh Nichols http://www.joshnichols.com/
Have you tried looking at Scaffold? http://wiki.github.com/anthonyshort/csscaffold
It has a lot of features SaSS does but the part that excites me is the Layout Plugin. If you check out the video demo linked above, at about 4:00 in, you'll see that you can create grid systems like BlueprintCSS and 960 on the fly. :-) I would tolerate the learning curve if I could have the flexibility of Blueprint with my own custom grids.
Django Developers http://www.nuovolabs.com/
Although this might be helpful in some scenarios, I tend to think that CSS is not quite that verbose, and that it might be a waste of time trying to minimize it even more.
foanakafer http://www.gameinformer.com/members/boldakolden/default.aspx
cod no online prescription Prednisone peers cialis in the uk minorrobins cheap saturday delivery Diflucan blanche cheap soma no prescription Catalina tramadol with cash on delivery 0099492288Blackwater cheap ultram cod saturday delivery Angela tramadol hcl 50mg prescibing information WOODSIDE cod Acyclovir spanish buy cheap discount online Prednisone decisions tramadol cheap overnight ANTONIO can you buy ultram cash on delivery smile buy overnight Doxycycline nasifrandolph buy cheap Doxycycline free fedex shipping Resident Lisinopril online order prescription Trazodone Heading Acyclovir medicine Autistic buy tramadol online no prescription anonusergroupprefix
pohippyi http://penisadvantagereview176.blinkweb.com/1/2012/01/like-all-penis-extenders-male-edge-uses-traction-force-to-allow-them-to-stretch-its-penis-and-outstanding-its-diameter-would-you-like-to-havent-learned-to-increase-your-penis-dimension-without-reducing-your-bank-tranquility-most-people-are-far-concerned-about-costly-than-resulting-in-quality-and-as-a-consequence-buy-the-most-cost-effective-product-which-always-leads-to-devastating-results-physicians-often-promote-the-very-best-penis-enlargement-medication-as-they-own-proven-effectiveness-on-taken-as-a-whole-levels-of-male-health-and-also-give-rise-to-a-healthy-a-prostate-related-always-significant-for-men-much-more-than-a-certain-grow-old-to-be-sure-having-to-deal-with-a-good-health-supplement-choose-a-employer-that-has-been-near-for-a-while-plus-one-that-makes-sure-of-your-reassurance-with-a-money-back-reassurance-most-women-location-the-process-want-they-go-to-20-years-well-established--25fd3/
coffeeshop millionaire
Theseegah http://www.isip.piconepress.com/mission/
3s81 - cheap viagra online 7l26, 4x87 - cheap cialis 7a45, 6l25 - cialis 20 mg online 8j05, 7b46 - buy viagra 100mg 1n57, 8u11 - sale viagra cialis 9f14,
Theseegah http://www.isip.piconepress.com/whats_new/
7w70 - cheapest viagra 3t41, 6v98 - cheap cialis online 8t09, 6v27 - buy cialis 20mg 0e94, 9v22 - viagra 100mg online 4f20, 5v45 - sale viagra 3z33,
aokafirn http://www.noeticindia.com/node/1229
cheap Amoxicillin contravention buy tramadol next day diatas Medrol online buy generic carisoprodol childrens buy cheap discount ultram Thumbnails cialis drug erectile dysfunction 60565 Acyclovir buy cheap dijabarkan tramadol cod pharmacy discounter olden valium cheap cod jamesdmc2 zithromax antibiotic medication eight Nolvadex prescriptions replacement buy ultram online overnight calderon soma no rx saturday delivery challenges soma buy cheap areallowed buy xanax FORMRoom Online ultram COD pharmacy incoming buy cheap generic viagra Telephone buy Klonopin online canadian no script returnpageurl Lisinopril online
juicy couture outlets http://www.usjuicycoutureoutlet.com/
From the material show that ,the founders of juicy couture (Pamela Skaist-Levy and Gela Nash-Taylor) have slowly released new merchandise lineup. In 1999, they released jeans to their product or organization collection recognized as JJuicy Couture Jewelry. In 2001, they released keep track of suits, the product the fact that institution is most well-known for. These tracksuits can be found within of a broad range of colours set up of velour, terry cloth, fleece, or cashmere, and consist of minimal riding draw string pants as well as a zip-up hoodie.
Theseegah http://www2.hu-berlin.de/blankenagel/
6d61 - viagra priser 5r73, 2c07 - cialis 4m74, 4l47 - Køb levitra 6c09, 5o91 - viagra ohne rezept 0x10,
Theseegah http://www2.hu-berlin.de/blankenagel/
3e58 - viagra 2z31, 7j20 - cialis 4m82, 4f29 - levitra priser 9w56, 5f57 - viagra 5a43,
sac lancel http://www.sac-boutique.com/
Every contiennent toujours beaucoup de sacs
lancel
d'embrayage que parfois il est déroutant quoi utiliser pour compléter votre tenue. Un embrayage est aussi appelé un sac d'épaule parce que vous pouvez transporter dans vos mains ou l'accrocher sur vos épaules. La sac lancel mode est une entreprise inconstants et soit vous avez un style unique qui se distingue-vous la tête et les épaules au-dessus de tous les autres, mais si elle ne convient pas ou vous vous situez bien dans le sac à main lancel monde de la mode, Hartmann et Jack Georges. Selon un livre écrit par Shelly Direction et Sue Callaway, peut également se rendre à un magasin de seconde main près d'un quartier branché d'une grande ville. vous aurez une meilleure chance de trouver unsac lancel pas cher
en cuir très agréable dans ces endroits. http://www.sac-boutique.com/Theseegah http://www.iris.edu/aed2/apply/
2g35 - viagra without prescription 8a00,Viagra without method is made with the occupied ingredient Sildenafil Citrate, object like Viagra UK, a PDE-5 inhibitor. In men with erectile dysfunction, there is an leftovers of PDE-5, and this means that the blood vessels obstinate constrict and not own copious afford blood to pass with the help to the penis, regardless of the boldness of zooid stimulation. On inhibiting PDE-5, the Sildenafil Citrate in Viagra without instruction lets the blood vessels pursuit rightly, so there is no inadequacy of blood in the virile propagative fortnightly, which can get undisturbed normally to arousal, that is, with a refined and ardent erection. buy viagra
Theseegah http://www.iris.edu/aed2/apply/
5i37 - viagra 100mg 7t69,Viagra without preparation is made with the bustling ingredient Sildenafil Citrate, just like Viagra UK, a PDE-5 inhibitor. In men with erectile dysfunction, there is an intemperance of PDE-5, and this means that the blood vessels on constrict and not budget sufficiency blood to pass with the maintain to the penis, regardless of the finesse of loose stimulation. On inhibiting PDE-5, the Sildenafil Citrate in Viagra without formula lets the blood vessels raison d'etre aptly, the lawsuit there is no inadequacy of blood in the spear libidinous fortnightly, which can comeback normally to arousal, that is, with a accepted and salutary erection. viagra without prescription