27% (4 votes)
13% (2 votes)
0% (0 votes)
60% (9 votes)
Total votes: 15

Started to use Less a few

Started to use Less a few weeks ago as a colleague insisted it was helping cut his major project development time hugely and he went on and on and on about it Smile. Have to agree being able to create variables, mixins etc does help with many long-winded rulesets or simply provide ability to insert pre-configured snippets for box-shadows, border-radius etc.

The ability to be able to pass args to mixins is quite sweet as well so I can write:

.border-radius(@radius: 6px){
 -moz-border-radius: @radius;
 -webkit-border-radius: @radius;
 border-radius: @radius;
Then in main less file I can write:
#container {
or feed new unit values for another element:
#header {

Found a winblows compiler that compiles the less files to real world CS files, very smoothly, very quickly so that you don't notice click save on your less file and it instantly compiles the css files quicker than one can switch to browser to view results, which was a concern initially.

It's early days, I'm still slowly building a generic set of files to use and reading Andy Clark's guides/posts on his love for and approach to using it.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

I looked into 'less', I think

I looked into 'less', I think it was, and superficially at that, a while back. I remember my reaction was something along the lines of "that's silly".

It may well be a case of old man syndrome, and being set in my ways. It may well be that there is no particular benefit gained from adding another layer of abstraction/complexity to something I find remarkably easy. (I first wrote simple, but realized you'd simply say I was simple minded. Wink)

I am reminded of preprocessor directives in C/C++ et al which are certainly helpful when writing thousands of lines of convoluted code, but add considerably to the initial debugging time. In css though, there are no decision trees, no calls to functions or methods, no objects with their inheritances (though there are those who would complicate things with OOP-like emulation of inheritance), no loops, no nothing in a programming vein. It's a declaratory language; not programming.

There is a simple algorithm[1] for applying the rule-sets, and if your css is well structured as a top-down cascade, no preprocessing other than @ rules are needed.

That's my story, and I'm sticking to it; unless someone can show me compelling reason otherwise.



[1] See CSS 2.1, ยง2.3 The CSS 2.1 processing model

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

I'd be inclined to say you

I'd be inclined to say you were simple minded but you intercepted that one Smile

As often I actually do tend to agree with all you say above especially about needlessly adding abstraction layers complicating what is already a fairly straightforward coding process, I'm on record time and time again on the issue of CSS frameworks and do still utterly despair at the damage they cause and the licence they give to non developers to peddle themselves as having experience and ability to create layouts and web sites.

In regard of preprocessors such as .Less I tend nowadays to worry that I come across simply as negative when ever someone says how great these things are, few seem to understand why they're not or why they may have relevance but only once one has advanced to a certain level of competence.

Les does not lend me any great advantage but it does not interfere greatly in the process, as I have my .less files configured in the editor to act as css files I have all normal syntax highlighting and I simply write in that file as I would have in the actual css file, which I now don't ever directly edit. In the less file I tend thus far to actually write common CSS rules with cascade and flow unaffected, occasionally in a ruleset I can drop into less syntax to include a complex ruleset or combination of properties.

It's only due to the fact that I can ignore less and still work as normal that I even considered trialling it's use, mainly for the ability to build snippets that I can very simply re-use from the include mixin file. The fact that it auto compiles to the css folder and file faster than one can type means one doesn't get slowed down by it and one uploads a normal CSS file at the end of the process as per normal.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me