From f3c6d31d4cc27ea32c50bc9e17be3c890fa17f3e Mon Sep 17 00:00:00 2001 From: cloudhead Date: Fri, 23 Jul 2010 19:49:33 -0400 Subject: [PATCH] (dist) build 1.0.33 --- dist/less-1.0.32.min.js | 65 -------- dist/{less-1.0.32.js => less-1.0.33.js} | 187 +++++++++++++++--------- dist/less-1.0.33.min.js | 66 +++++++++ 3 files changed, 187 insertions(+), 131 deletions(-) delete mode 100644 dist/less-1.0.32.min.js rename dist/{less-1.0.32.js => less-1.0.33.js} (94%) create mode 100644 dist/less-1.0.33.min.js diff --git a/dist/less-1.0.32.min.js b/dist/less-1.0.32.min.js deleted file mode 100644 index d2df8b79..00000000 --- a/dist/less-1.0.32.min.js +++ /dev/null @@ -1,65 +0,0 @@ -// -// LESS - Leaner CSS v1.0.32 -// http://lesscss.org -// -// Copyright (c) 2010, Alexis Sellier -// Licensed under the Apache 2.0 License. -// -(function(E){function q(d){return E.less[d.split("/")[1]]}function R(){for(var d=document.getElementsByTagName("style"),b=0;b0)g.firstChild.nodeValue!==i.nodeValue&& -g.replaceChild(i,g.firstChild);else g.appendChild(i)})(document.createTextNode(d));if(e&&C){I("saving "+a+" to cache.");C.setItem(a,d);C.setItem(a+":timestamp",e)}}function $(d,b,e){function g(h,i,n){if(h.status>=200&&h.status<300)i(h.responseText,h.getResponseHeader("Last-Modified"));else typeof n==="function"&&n(h.status,d)}var a=ba(),j=O?false:o.async;typeof a.overrideMimeType==="function"&&a.overrideMimeType("text/css");a.open("GET",d,j);a.send(null);if(O)a.status===0?b(a.responseText):e(a.status); -else if(j)a.onreadystatechange=function(){a.readyState==4&&g(a,b,e)};else g(a,b,e)}function ba(){if(E.XMLHttpRequest)return new XMLHttpRequest;else try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(d){I("browser doesn't support AJAX.");return null}}function aa(d){return d&&d.parentNode.removeChild(d)}function I(d){o.env=="development"&&typeof console!=="undefined"&&console.log("less: "+d)}function V(d,b){var e="less-error-message:"+P(b);if(!d.extract)throw d;var g=document.createElement("div"), -a;g.id=e;g.className="less-error-message";g.innerHTML="

"+(d.message||"There is an error in your .less file")+'

'+b+" on line "+d.line+", column "+(d.column+1)+":

"+'
\n
[-1]{0}
\n
[0]{current}
\n
[1]{2}
\n
'.replace(/\[(-?\d)\]/g,function(j,h){return parseInt(d.line)+parseInt(h)||""}).replace(/\{(\d)\}/g,function(j,h){return d.extract[parseInt(h)]||""}).replace(/\{current\}/, -d.extract[1].slice(0,d.column)+''+d.extract[1].slice(d.column)+"");N(".less-error-message span {\nmargin-right: 15px;\n}\n.less-error-message pre {\ncolor: #ee4444;\npadding: 4px 0;\nmargin: 0;\n}\n.less-error-message pre.ctx {\ncolor: #dd7777;\n}\n.less-error-message h3 {\npadding: 15px 0 5px 0;\nmargin: 0;\n}\n.less-error-message a {\ncolor: #10a\n}\n.less-error-message .error {\ncolor: red;\nfont-weight: bold;\npadding-bottom: 2px;\nborder-bottom: 1px dashed red;\n}", -{title:"error-message"});g.style.cssText="font-family: Arial, sans-serif;border: 1px solid #e00;background-color: #eee;border-radius: 5px;-webkit-border-radius: 5px;-moz-border-radius: 5px;color: #e00;padding: 15px;margin-bottom: 15px";if(o.env=="development")a=setInterval(function(){if(document.body){document.getElementById(e)?document.body.replaceChild(g,document.getElementById(e)):document.body.insertBefore(g,document.body.firstChild);clearInterval(a)}},10)}if(!Array.isArray)Array.isArray=function(d){return Object.prototype.toString.call(d)=== -"[object Array]"||d instanceof Array};if(!Array.prototype.forEach)Array.prototype.forEach=function(d,b){for(var e=this.length>>>0,g=0;g>>0,g=new Array(e),a=0;a>>0,e=0;if(b===0&&arguments.length===1)throw new TypeError;if(arguments.length>=2)var g=arguments[1];else{do{if(e in this){g=this[e++];break}if(++e>=b)throw new TypeError;}while(1)}for(;e=e)return-1;if(b<0)b+=e;for(;bH){u[n]=u[n].slice(i-H);H=i}}function a(f){var k,l,p;if(f instanceof -Function)return f.call(W.parsers);else if(typeof f==="string"){f=h.charAt(i)===f?f:null;k=1;g()}else{g();if(f=f.exec(u[n]))k=f[0].length;else return null}if(f){mem=i+=k;for(p=i+u[n].length-k;i0)throw new Error("Missing closing '}'");return L.map(function(D){return D.join("")})}([[]]);l=new m.Ruleset([], -a(this.parsers.primary));l.root=true;l.toCSS=function(L){var F,G;return function(z,A){function w(v){return v?(h.slice(0,v).match(/\n/g)||"").length:null}var y=[];z=z||{};if(typeof A==="object"&&!Array.isArray(A)){A=Object.keys(A).map(function(v){var D=A[v];if(!(D instanceof m.Value)){D instanceof m.Expression||(D=new m.Expression([D]));D=new m.Value([D])}return new m.Rule("@"+v,D,false,0)});y=[new m.Ruleset(null,A)]}try{var B=L.call(this,[],{frames:y,compress:z.compress||false})}catch(s){G=h.split("\n"); -F=w(s.index);z=s.index;for(y=-1;z>=0&&h.charAt(z)!=="\n";z--)y++;throw{name:"NameError",message:s.message,filename:d.filename,index:s.index,line:typeof F==="number"?F+1:null,callLine:s.call&&w(s.call)+1,callExtract:G[w(s.call)],stack:s.stack,column:y,extract:[G[F-1],G[F],G[F+1]]};}return z.compress?B.replace(/(\s)+/g,"$1"):B}}(l.toCSS);if(i=0&&h.charAt(Q)!=="\n";Q--)Z++;K={name:"ParseError",message:"Syntax Error on line "+ -f,filename:d.filename,line:f,column:Z,extract:[p[f-2],p[f-1],p[f]]}}if(this.imports.queue.length>0)X=function(){k(K,l)};else k(K,l)},parsers:{primary:function(){for(var f,k=[];(f=a(this.mixin.definition)||a(this.rule)||a(this.ruleset)||a(this.mixin.call)||a(this.comment)||a(this.directive))||a(/^[\s\n]+/);)f&&k.push(f);return k},comment:function(){var f;if(h.charAt(i)==="/")if(h.charAt(i+1)==="/")return new m.Comment(a(/^\/\/.*/),true);else if(f=a(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))return new m.Comment(f)}, -entities:{quoted:function(){var f;if(!(h.charAt(i)!=='"'&&h.charAt(i)!=="'"))if(f=a(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/))return new m.Quoted(f[0],f[1]||f[2])},keyword:function(){var f;if(f=a(/^[A-Za-z-]+/))return new m.Keyword(f)},call:function(){var f,k;if(f=/^([\w-]+|%)\(/.exec(u[n])){f=f[1].toLowerCase();if(f==="url")return null;else i+=f.length+1;if(f==="alpha")return a(this.alpha);k=a(this.entities.arguments);if(a(")"))if(f)return new m.Call(f,k)}},arguments:function(){for(var f= -[],k;k=a(this.expression);){f.push(k);if(!a(","))break}return f},literal:function(){return a(this.entities.dimension)||a(this.entities.color)||a(this.entities.quoted)},url:function(){var f;if(!(h.charAt(i)!=="u"||!a(/^url\(/))){f=a(this.entities.quoted)||a(this.entities.variable)||a(/^[-\w%@$\/.&=:;#+?]+/);if(!a(")"))throw new Error("missing closing ) for url()");return new m.URL(f.value||f instanceof m.Variable?f:new m.Anonymous(f))}},variable:function(){var f,k=i;if(h.charAt(i)==="@"&&(f=a(/^@[\w-]+/)))return new m.Variable(f, -k)},color:function(){var f;if(h.charAt(i)==="#"&&(f=a(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)))return new m.Color(f[1])},dimension:function(){var f;f=h.charCodeAt(i);if(!(f>57||f<45||f===47))if(f=a(/^(-?\d*\.?\d+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm)?/))return new m.Dimension(f[1],f[2])}},variable:function(){var f;if(h.charAt(i)==="@"&&(f=a(/^(@[\w-]+)\s*:/)))return f[1]},shorthand:function(){var f,k;if(j(/^[@\w.%-]+\/[@\w.-]+/))if((f=a(this.entity))&&a("/")&&(k=a(this.entity)))return new m.Shorthand(f, -k)},mixin:{call:function(){var f=[],k,l,p,K=i;k=h.charAt(i);if(!(k!=="."&&k!=="#")){for(;k=a(/^[#.][\w-]+/);){f.push(new m.Element(l,k));l=a(">")}a("(")&&(p=a(this.entities.arguments))&&a(")");if(f.length>0&&(a(";")||j("}")))return new m.mixin.Call(f,p,K)}},definition:function(){var f,k=[],l,p;if(!(h.charAt(i)!=="."&&h.charAt(i)!=="#"||j(/^[^{]*(;|})/)))if(f=a(/^([#.][\w-]+)\s*\(/)){for(f=f[1];l=a(/^@[\w-]+/)||a(this.entities.literal)||a(this.entities.keyword);){if(l[0]==="@")if(a(":"))if(p=a(this.expression))k.push({name:l, -value:p});else throw new Error("Expected value");else k.push({name:l});else k.push({value:l});if(!a(","))break}if(!a(")"))throw new Error("Expected )");if(l=a(this.block))return new m.mixin.Definition(f,k,l)}}},entity:function(){return a(this.entities.literal)||a(this.entities.variable)||a(this.entities.url)||a(this.entities.call)||a(this.entities.keyword)},end:function(){return a(";")||j("}")},alpha:function(){var f;if(a(/^opacity=/i))if(f=a(/^\d+/)||a(this.entities.variable)){if(!a(")"))throw new Error("missing closing ) for alpha()"); -return new m.Alpha(f)}},element:function(){var f;c=a(this.combinator);if(f=a(/^[.#:]?[\w-]+/)||a("*")||a(this.attribute)||a(/^\([^)@]+\)/))return new m.Element(c,f)},combinator:function(){var f=h.charAt(i);if(f===">"||f==="&"||f==="+"||f==="~"){for(i++;h.charAt(i)===" ";)i++;return new m.Combinator(f)}else if(f===":"&&h.charAt(i+1)===":"){for(i+=2;h.charAt(i)===" ";)i++;return new m.Combinator("::")}else return h.charAt(i-1)===" "?new m.Combinator(" "):new m.Combinator(null)},selector:function(){for(var f, -k=[],l;f=a(this.element);){l=h.charAt(i);k.push(f);if(l==="{"||l==="}"||l===";"||l===",")break}if(k.length>0)return new m.Selector(k)},tag:function(){return a(/^[a-zA-Z][a-zA-Z-]*[0-9]?/)||a("*")},attribute:function(){var f="",k,l,p;if(a("[")){if(k=a(/^[a-z-]+/)||a(this.entities.quoted))f=(p=a(/^[|~*$^]?=/))&&(l=a(this.entities.quoted)||a(/^[\w-]+/))?[k,p,l.toCSS?l.toCSS():l].join(""):k;if(a("]"))if(f)return"["+f+"]"}},block:function(){var f;if(a("{")&&(f=a(this.primary))&&a("}"))return f},ruleset:function(){var f= -[],k,l;b();if(k=/^([.#: \w-]+)[\s\n]*\{/.exec(u[n])){i+=k[0].length-1;f=[new m.Selector([new m.Element(null,k[1])])]}else{for(;k=a(this.selector);){f.push(k);if(!a(","))break}k&&a(this.comment)}if(f.length>0&&(l=a(this.block)))return new m.Ruleset(f,l);else{t=i;e()}},rule:function(){var f;f=h.charAt(i);var k;b();if(!(f==="."||f==="#"||f==="&"))if(name=a(this.variable)||a(this.property)){if(name.charAt(0)!="@"&&(match=/^([^@+\/'"*(;{}-]*);/.exec(u[n]))){i+=match[0].length-1;f=new m.Anonymous(match[1])}else f= -name==="font"?a(this.font):a(this.value);k=a(this.important);if(f&&a(this.end))return new m.Rule(name,f,k,x);else{t=i;e()}}},"import":function(){var f;if(a(/^@import\s+/)&&(f=a(this.entities.quoted)||a(this.entities.url))&&a(";"))return new m.Import(f,Y)},directive:function(){var f,k,l;if(h.charAt(i)==="@")if(k=a(this["import"]))return k;else if(f=a(/^@media|@page/)){l=a(/^[^{]+/).trim();if(k=a(this.block))return new m.Directive(f+" "+l,k)}else if(f=a(/^@[-a-z]+/))if(f==="@font-face"){if(k=a(this.block))return new m.Directive(f, -k)}else if((k=a(this.entity))&&a(";"))return new m.Directive(f,k)},font:function(){for(var f=[],k=[],l;l=a(this.shorthand)||a(this.entity);)k.push(l);f.push(new m.Expression(k));if(a(","))for(;l=a(this.expression);){f.push(l);if(!a(","))break}return new m.Value(f)},value:function(){for(var f,k=[];f=a(this.expression);){k.push(f);if(!a(","))break}if(k.length>0)return new m.Value(k)},important:function(){if(h.charAt(i)==="!")return a(/^! *important/)},sub:function(){var f;if(a("(")&&(f=a(this.expression))&& -a(")"))return f},multiplication:function(){var f,k,l,p;if(f=a(this.operand)){for(;(l=a("/")||a("*"))&&(k=a(this.operand));)p=new m.Operation(l,[p||f,k]);return p||f}},addition:function(){var f,k,l,p;if(f=a(this.multiplication)){for(;(l=a(/^[-+]\s+/)||h.charAt(i-1)!=" "&&(a("+")||a("-")))&&(k=a(this.multiplication));)p=new m.Operation(l,[p||f,k]);return p||f}},operand:function(){return a(this.sub)||a(this.entities.dimension)||a(this.entities.color)||a(this.entities.variable)||a(this.entities.call)}, -expression:function(){for(var f,k=[];f=a(this.addition)||a(this.entity);)k.push(f);if(k.length>0)return new m.Expression(k)},property:function(){var f;if(f=a(/^(\*?-?[-a-z_0-9]+)\s*:/))return f[1]}}}};if(typeof E!=="undefined")o.Parser.importer=function(d,b,e){if(d[0]!=="/"&&b.length>0)d=b[0]+d;U({href:d,title:d},e,true)};(function(d){function b(a){return d.functions.hsla(a.h,a.s,a.l,a.a)}function e(a){if(a instanceof d.Dimension)return parseFloat(a.unit=="%"?a.value/100:a.value);else if(typeof a=== -"number")return a;else throw{error:"RuntimeError",message:"color functions take numbers as parameters"};}function g(a){return Math.min(1,Math.max(0,a))}d.functions={rgb:function(a,j,h){return this.rgba(a,j,h,1)},rgba:function(a,j,h,i){a=[a,j,h].map(function(n){return e(n)});i=e(i);return new d.Color(a,i)},hsl:function(a,j,h){return this.hsla(a,j,h,1)},hsla:function(a,j,h,i){function n(t){t=t<0?t+1:t>1?t-1:t;return t*6<1?x+(r-x)*t*6:t*2<1?r:t*3<2?x+(r-x)*(2/3-t)*6:x}a=e(a)%360/360;j=e(j);h=e(h);i= -e(i);var r=h<=0.5?h*(j+1):h+j-h*j,x=h*2-r;return this.rgba(n(a+1/3)*255,n(a)*255,n(a-1/3)*255,i)},hue:function(a){return new d.Dimension(Math.round(a.toHSL().h))},saturation:function(a){return new d.Dimension(Math.round(a.toHSL().s*100),"%")},lightness:function(a){return new d.Dimension(Math.round(a.toHSL().l*100),"%")},alpha:function(a){return new d.Dimension(a.toHSL().a)},saturate:function(a,j){a=a.toHSL();a.s+=j.value/100;a.s=g(a.s);return b(a)},desaturate:function(a,j){a=a.toHSL();a.s-=j.value/ -100;a.s=g(a.s);return b(a)},lighten:function(a,j){a=a.toHSL();a.l+=j.value/100;a.l=g(a.l);return b(a)},darken:function(a,j){a=a.toHSL();a.l-=j.value/100;a.l=g(a.l);return b(a)},spin:function(a,j){a=a.toHSL();j=(a.h+j.value)%360;a.h=j<0?360+j:j;return b(a)},greyscale:function(a){return this.desaturate(a,new d.Dimension(100))},e:function(a){return new d.Anonymous(a)},"%":function(a){for(var j=Array.prototype.slice.call(arguments,1),h=a.content,i=0;i255?255:b<0?0:b).toString(16);return b.length===1?"0"+b:b}).join("")},operate:function(b,e){var g=[];e instanceof d.Color||(e=e.toColor());for(var a=0;a<3;a++)g[a]=d.operate(b,this.rgb[a],e.rgb[a]);return new d.Color(g)},toHSL:function(){var b= -this.rgb[0]/255,e=this.rgb[1]/255,g=this.rgb[2]/255,a=this.alpha,j=Math.max(b,e,g),h=Math.min(b,e,g),i,n=(j+h)/2,r=j-h;if(j===h)i=h=0;else{h=n>0.5?r/(2-j-h):r/(j+h);switch(j){case b:i=(e-g)/r+(e":b.compress?">":" > "}[this.value]}})(q("less/tree"));(function(d){d.Expression=function(b){this.value= -b};d.Expression.prototype={eval:function(b){return this.value.length>1?new d.Expression(this.value.map(function(e){return e.eval(b)})):this.value[0].eval(b)},toCSS:function(b){return this.value.map(function(e){return e.toCSS(b)}).join(" ")}}})(q("less/tree"));(function(d){d.Import=function(b,e){var g=this;this._path=b;this.path=b instanceof d.Quoted?/\.(le?|c)ss$/.test(b.content)?b.content:b.content+".less":b.value.content||b.value;(this.css=/css$/.test(this.path))||e.push(this.path,function(a){if(!a)throw new Error("Error parsing "+ -g.path);g.root=a})};d.Import.prototype={toCSS:function(){return this.css?"@import "+this._path.toCSS()+";\n":""},eval:function(){if(this.css)return this;else{for(var b=0;b0){for(j=0;j -1?Array.prototype.push.apply(g,j.find(new d.Selector(b.elements.slice(1)),e)):g.push(j);break}});return this._lookups[a]=g},toCSS:function(b,e){var g=[],a=[],j=[],h=[];if(!this.root)if(b.length===0)h=this.selectors.map(function(r){return[r]});else for(var i=0;i0){h=h.map(function(r){return r.map(function(x){return x.toCSS(e)}).join("").trim()}).join(e.compress?",":h.length>3?",\n":", ");g.push(h,(e.compress?"{":" {\n ")+a.join(e.compress?"":"\n ")+(e.compress?"}":"\n}\n"))}g.push(j);return g.join("")+(e.compress?"\n":"")}}})(q("less/tree")); -(function(d){d.Selector=function(b){this.elements=b;if(this.elements[0].combinator.value==="")this.elements[0].combinator.value=" "};d.Selector.prototype.match=function(b){return this.elements[0].value===b.elements[0].value?true:false};d.Selector.prototype.toCSS=function(b){if(this._css)return this._css;return this._css=this.elements.map(function(e){return typeof e==="string"?" "+e.trim():e.toCSS(b)}).join("")}})(q("less/tree"));(function(d){d.URL=function(b){this.value=b};d.URL.prototype={toCSS:function(){return"url("+ -this.value.toCSS()+")"},eval:function(b){this.value=this.value.eval(b);return this}}})(q("less/tree"));(function(d){d.Value=function(b){this.value=b;this.is="value"};d.Value.prototype={eval:function(b){return this.value.length===1?this.value[0].eval(b):new d.Value(this.value.map(function(e){return e.eval(b)}))},toCSS:function(b){return this.value.map(function(e){return e.toCSS(b)}).join(b.compress?",":", ")}}})(q("less/tree"));(function(d){d.Variable=function(b,e){this.name=b;this.index=e};d.Variable.prototype= -{eval:function(b){var e,g,a=this.name;if(e=d.find(b.frames,function(j){if(g=j.variable(a))return g.value.eval(b)}))return e;else throw{message:"variable "+this.name+" is undefined",index:this.index};}}})(q("less/tree"));q("less/tree").find=function(d,b){for(var e=0,g;e0||O?"development":"production";o.async=false;o.poll=O?1E3:1500;o.watch=function(){return this.watchMode=true};o.unwatch=function(){return this.watchMode=false};if(o.env==="development"){o.optimization=0;/!watch/.test(location.hash)&&o.watch();o.watchTimer=setInterval(function(){o.watchMode&&T(function(d,b,e){d&&N(d.toCSS(),b,e.lastModified)})},o.poll)}else o.optimization=3;var C;try{C=typeof E.localStorage==="undefined"?null:E.localStorage}catch(ca){C=null}var M= -document.getElementsByTagName("link"),S=/^text\/(x-)?less$/;o.sheets=[];for(var J=0;J 0) { + if (path.charAt(0) !== '/' && paths.length > 0) { path = paths[0] + path; } // We pass `true` as 3rd argument, to force the reload of the import. @@ -1266,7 +1279,7 @@ tree.functions = { return this.desaturate(color, new(tree.Dimension)(100)); }, e: function (str) { - return new(tree.Anonymous)(str); + return new(tree.Anonymous)(str instanceof tree.JavaScript ? str.evaluated : str); }, '%': function (quoted /* arg, arg, ...*/) { var args = Array.prototype.slice.call(arguments, 1), @@ -1533,7 +1546,7 @@ tree.Directive.prototype = { }, eval: function (env) { env.frames.unshift(this); - this.ruleset && this.ruleset.eval(env); + this.ruleset = this.ruleset && this.ruleset.eval(env); env.frames.shift(); return this; }, @@ -1651,19 +1664,23 @@ tree.Import.prototype = { return ""; } }, - eval: function () { + eval: function (env) { + var ruleset; + if (this.css) { return this; } else { - for (var i = 0; i < this.root.rules.length; i++) { - if (this.root.rules[i] instanceof tree.Import) { + ruleset = new(tree.Ruleset)(null, this.root.rules.slice(0)); + + for (var i = 0; i < ruleset.rules.length; i++) { + if (ruleset.rules[i] instanceof tree.Import) { Array.prototype .splice - .apply(this.root.rules, - [i, 1].concat(this.root.rules[i].eval())); + .apply(ruleset.rules, + [i, 1].concat(ruleset.rules[i].eval(env))); } } - return this.root.rules; + return ruleset.rules; } } }; @@ -1671,6 +1688,42 @@ tree.Import.prototype = { })(require('less/tree')); (function (tree) { +tree.JavaScript = function (string, index) { + this.expression = string; + this.index = index; +}; +tree.JavaScript.prototype = { + toCSS: function () { + return JSON.stringify(this.evaluated); + }, + eval: function (env) { + var result, + expression = new(Function)('return (' + this.expression + ')'), + context = {}; + + for (var k in env.frames[0].variables()) { + context[k.slice(1)] = { + value: env.frames[0].variables()[k].value, + toJS: function () { + return this.value.eval(env).toCSS(); + } + }; + } + + try { + this.evaluated = expression.call(context); + } catch (e) { + throw { message: "JavaScript evaluation error: '" + e.name + ': ' + e.message + "'" , + index: this.index }; + } + return this; + } +}; + +})(require('less/tree')); + +(function (tree) { + tree.Keyword = function (value) { this.value = value }; tree.Keyword.prototype = { eval: function () { return this }, @@ -1735,10 +1788,11 @@ tree.mixin.Definition = function (name, params, rules) { this.frames = []; }; tree.mixin.Definition.prototype = { - toCSS: function () { return "" }, - variable: function (name) { return this.parent.variable.call(this, name) }, - find: function () { return this.parent.find.apply(this, arguments) }, - rulesets: function () { return this.parent.rulesets.apply(this) }, + toCSS: function () { return "" }, + variable: function (name) { return this.parent.variable.call(this, name) }, + variables: function () { return this.parent.variables.call(this) }, + find: function () { return this.parent.find.apply(this, arguments) }, + rulesets: function () { return this.parent.rulesets.apply(this) }, eval: function (env, args) { var frame = new(tree.Ruleset)(null, []), context; @@ -1758,16 +1812,15 @@ tree.mixin.Definition.prototype = { }); }, match: function (args, env) { - var argsLength = (args && args.length) || 0; + var argsLength = (args && args.length) || 0, len; - if (argsLength < this.required) { - return false; - } + if (argsLength < this.required) { return false } - for (var i = 0; i < Math.min(argsLength, this.arity); i++) { + len = Math.min(argsLength, this.arity); + + for (var i = 0; i < len; i++) { if (!this.params[i].name) { - if (args[i].wildcard) { continue } - else if (args[i].eval(env).toCSS() != this.params[i].value.eval(env).toCSS()) { + if (args[i].eval(env).toCSS() != this.params[i].value.eval(env).toCSS()) { return false; } } @@ -1872,66 +1925,70 @@ tree.Ruleset = function (selectors, rules) { }; tree.Ruleset.prototype = { eval: function (env) { - if (this.evaled) { return this } + var ruleset = new(tree.Ruleset)(this.selectors, this.rules.slice(0)); + + ruleset.root = this.root; // push the current ruleset to the frames stack - env.frames.unshift(this); + env.frames.unshift(ruleset); - // Store the frames around mixin definitions, - // so they can be evaluated like closures when the time comes. - for (var i = 0; i < this.rules.length; i++) { - if (this.rules[i] instanceof tree.mixin.Definition) { - this.rules[i].frames = env.frames.slice(0); + // Evaluate imports + if (ruleset.root) { + for (var i = 0; i < ruleset.rules.length; i++) { + if (ruleset.rules[i] instanceof tree.Import) { + Array.prototype.splice + .apply(ruleset.rules, [i, 1].concat(ruleset.rules[i].eval(env))); + } } } - // Evaluate imports - if (this.root) { - for (var i = 0; i < this.rules.length; i++) { - if (this.rules[i] instanceof tree.Import) { - Array.prototype.splice - .apply(this.rules, [i, 1].concat(this.rules[i].eval(env))); - } + // Store the frames around mixin definitions, + // so they can be evaluated like closures when the time comes. + for (var i = 0; i < ruleset.rules.length; i++) { + if (ruleset.rules[i] instanceof tree.mixin.Definition) { + ruleset.rules[i].frames = env.frames.slice(0); } } // Evaluate mixin calls. - for (var i = 0; i < this.rules.length; i++) { - if (this.rules[i] instanceof tree.mixin.Call) { + for (var i = 0; i < ruleset.rules.length; i++) { + if (ruleset.rules[i] instanceof tree.mixin.Call) { Array.prototype.splice - .apply(this.rules, [i, 1].concat(this.rules[i].eval(env))); + .apply(ruleset.rules, [i, 1].concat(ruleset.rules[i].eval(env))); } } // Evaluate everything else - for (var i = 0, rule; i < this.rules.length; i++) { - rule = this.rules[i]; + for (var i = 0, rule; i < ruleset.rules.length; i++) { + rule = ruleset.rules[i]; if (! (rule instanceof tree.mixin.Definition)) { - this.rules[i] = rule.eval ? rule.eval(env) : rule; + ruleset.rules[i] = rule.eval ? rule.eval(env) : rule; } } - this.evaled = true; // Pop the stack env.frames.shift(); - return this; + return ruleset; }, match: function (args) { return !args || args.length === 0; }, - variable: function (name) { - if (this._variables) { return this._variables[name] } + variables: function () { + if (this._variables) { return this._variables } else { - return (this._variables = this.rules.reduce(function (hash, r) { + return this._variables = this.rules.reduce(function (hash, r) { if (r instanceof tree.Rule && r.variable === true) { hash[r.name] = r; } return hash; - }, {}))[name]; + }, {}); } }, + variable: function (name) { + return this.variables()[name]; + }, rulesets: function () { if (this._rulesets) { return this._rulesets } else { @@ -1989,8 +2046,6 @@ tree.Ruleset.prototype = { } } - this.eval(env); - // Compile rules and rulesets for (var i = 0; i < this.rules.length; i++) { rule = this.rules[i]; diff --git a/dist/less-1.0.33.min.js b/dist/less-1.0.33.min.js new file mode 100644 index 00000000..5976ab91 --- /dev/null +++ b/dist/less-1.0.33.min.js @@ -0,0 +1,66 @@ +// +// LESS - Leaner CSS v1.0.33 +// http://lesscss.org +// +// Copyright (c) 2010, Alexis Sellier +// Licensed under the Apache 2.0 License. +// +(function(E){function q(d){return E.less[d.split("/")[1]]}function R(){for(var d=document.getElementsByTagName("style"),b=0;b0)g.firstChild.nodeValue!==i.nodeValue&& +g.replaceChild(i,g.firstChild);else g.appendChild(i)})(document.createTextNode(d));if(e&&C){I("saving "+a+" to cache.");C.setItem(a,d);C.setItem(a+":timestamp",e)}}function $(d,b,e){function g(h,i,n){if(h.status>=200&&h.status<300)i(h.responseText,h.getResponseHeader("Last-Modified"));else typeof n==="function"&&n(h.status,d)}var a=ba(),j=O?false:o.async;typeof a.overrideMimeType==="function"&&a.overrideMimeType("text/css");a.open("GET",d,j);a.send(null);if(O)a.status===0?b(a.responseText):e(a.status); +else if(j)a.onreadystatechange=function(){a.readyState==4&&g(a,b,e)};else g(a,b,e)}function ba(){if(E.XMLHttpRequest)return new XMLHttpRequest;else try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(d){I("browser doesn't support AJAX.");return null}}function aa(d){return d&&d.parentNode.removeChild(d)}function I(d){o.env=="development"&&typeof console!=="undefined"&&console.log("less: "+d)}function V(d,b){var e="less-error-message:"+P(b);if(!d.extract)throw d;var g=document.createElement("div"), +a;g.id=e;g.className="less-error-message";g.innerHTML="

"+(d.message||"There is an error in your .less file")+'

'+b+" on line "+d.line+", column "+(d.column+1)+":

"+'
\n
[-1]{0}
\n
[0]{current}
\n
[1]{2}
\n
'.replace(/\[(-?\d)\]/g,function(j,h){return parseInt(d.line)+parseInt(h)||""}).replace(/\{(\d)\}/g,function(j,h){return d.extract[parseInt(h)]||""}).replace(/\{current\}/, +d.extract[1].slice(0,d.column)+''+d.extract[1].slice(d.column)+"");N(".less-error-message span {\nmargin-right: 15px;\n}\n.less-error-message pre {\ncolor: #ee4444;\npadding: 4px 0;\nmargin: 0;\n}\n.less-error-message pre.ctx {\ncolor: #dd7777;\n}\n.less-error-message h3 {\npadding: 15px 0 5px 0;\nmargin: 0;\n}\n.less-error-message a {\ncolor: #10a\n}\n.less-error-message .error {\ncolor: red;\nfont-weight: bold;\npadding-bottom: 2px;\nborder-bottom: 1px dashed red;\n}", +{title:"error-message"});g.style.cssText="font-family: Arial, sans-serif;border: 1px solid #e00;background-color: #eee;border-radius: 5px;-webkit-border-radius: 5px;-moz-border-radius: 5px;color: #e00;padding: 15px;margin-bottom: 15px";if(o.env=="development")a=setInterval(function(){if(document.body){document.getElementById(e)?document.body.replaceChild(g,document.getElementById(e)):document.body.insertBefore(g,document.body.firstChild);clearInterval(a)}},10)}if(!Array.isArray)Array.isArray=function(d){return Object.prototype.toString.call(d)=== +"[object Array]"||d instanceof Array};if(!Array.prototype.forEach)Array.prototype.forEach=function(d,b){for(var e=this.length>>>0,g=0;g>>0,g=new Array(e),a=0;a>>0,e=0;if(b===0&&arguments.length===1)throw new TypeError;if(arguments.length>=2)var g=arguments[1];else{do{if(e in this){g=this[e++];break}if(++e>=b)throw new TypeError;}while(1)}for(;e=e)return-1;if(b<0)b+=e;for(;bH){v[n]=v[n].slice(i-H);H=i}}function a(f){var k,l,p;if(f instanceof +Function)return f.call(W.parsers);else if(typeof f==="string"){f=h.charAt(i)===f?f:null;k=1;g()}else{g();if(f=f.exec(v[n]))k=f[0].length;else return null}if(f){mem=i+=k;for(p=i+v[n].length-k;i0)throw new Error("Missing closing '}'");return L.map(function(D){return D.join("")})}([[]]); +l=new m.Ruleset([],a(this.parsers.primary));l.root=true;l.toCSS=function(L){var F,G;return function(z,A){function w(t){return t?(h.slice(0,t).match(/\n/g)||"").length:null}var y=[];z=z||{};if(typeof A==="object"&&!Array.isArray(A)){A=Object.keys(A).map(function(t){var D=A[t];if(!(D instanceof m.Value)){D instanceof m.Expression||(D=new m.Expression([D]));D=new m.Value([D])}return new m.Rule("@"+t,D,false,0)});y=[new m.Ruleset(null,A)]}try{var B=L.call(this,{frames:y}).toCSS([],{compress:z.compress|| +false})}catch(s){G=h.split("\n");F=w(s.index);z=s.index;for(y=-1;z>=0&&h.charAt(z)!=="\n";z--)y++;throw{type:s.type,message:s.message,filename:d.filename,index:s.index,line:typeof F==="number"?F+1:null,callLine:s.call&&w(s.call)+1,callExtract:G[w(s.call)],stack:s.stack,column:y,extract:[G[F-1],G[F],G[F+1]]};}return z.compress?B.replace(/(\s)+/g,"$1"):B}}(l.eval);if(i=0&&h.charAt(Q)!=="\n";Q--)Z++;K={name:"ParseError", +message:"Syntax Error on line "+f,filename:d.filename,line:f,column:Z,extract:[p[f-2],p[f-1],p[f]]}}if(this.imports.queue.length>0)X=function(){k(K,l)};else k(K,l)},parsers:{primary:function(){for(var f,k=[];(f=a(this.mixin.definition)||a(this.rule)||a(this.ruleset)||a(this.mixin.call)||a(this.comment)||a(this.directive))||a(/^[\s\n]+/);)f&&k.push(f);return k},comment:function(){var f;if(h.charAt(i)==="/")if(h.charAt(i+1)==="/")return new m.Comment(a(/^\/\/.*/),true);else if(f=a(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))return new m.Comment(f)}, +entities:{quoted:function(){var f;if(!(h.charAt(i)!=='"'&&h.charAt(i)!=="'"))if(f=a(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/))return new m.Quoted(f[0],f[1]||f[2])},keyword:function(){var f;if(f=a(/^[A-Za-z-]+/))return new m.Keyword(f)},call:function(){var f,k;if(f=/^([\w-]+|%)\(/.exec(v[n])){f=f[1].toLowerCase();if(f==="url")return null;else i+=f.length+1;if(f==="alpha")return a(this.alpha);k=a(this.entities.arguments);if(a(")"))if(f)return new m.Call(f,k)}},arguments:function(){for(var f= +[],k;k=a(this.expression);){f.push(k);if(!a(","))break}return f},literal:function(){return a(this.entities.dimension)||a(this.entities.color)||a(this.entities.quoted)},url:function(){var f;if(!(h.charAt(i)!=="u"||!a(/^url\(/))){f=a(this.entities.quoted)||a(this.entities.variable)||a(/^[-\w%@$\/.&=:;#+?]+/);if(!a(")"))throw new Error("missing closing ) for url()");return new m.URL(f.value||f instanceof m.Variable?f:new m.Anonymous(f))}},variable:function(){var f,k=i;if(h.charAt(i)==="@"&&(f=a(/^@[\w-]+/)))return new m.Variable(f, +k)},color:function(){var f;if(h.charAt(i)==="#"&&(f=a(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)))return new m.Color(f[1])},dimension:function(){var f;f=h.charCodeAt(i);if(!(f>57||f<45||f===47))if(f=a(/^(-?\d*\.?\d+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm)?/))return new m.Dimension(f[1],f[2])},javascript:function(){var f;if(h.charAt(i)==="`")if(f=a(/^`([^`]*)`/))return new m.JavaScript(f[1],i)}},variable:function(){var f;if(h.charAt(i)==="@"&&(f=a(/^(@[\w-]+)\s*:/)))return f[1]},shorthand:function(){var f, +k;if(j(/^[@\w.%-]+\/[@\w.-]+/))if((f=a(this.entity))&&a("/")&&(k=a(this.entity)))return new m.Shorthand(f,k)},mixin:{call:function(){var f=[],k,l,p,K=i;k=h.charAt(i);if(!(k!=="."&&k!=="#")){for(;k=a(/^[#.][\w-]+/);){f.push(new m.Element(l,k));l=a(">")}a("(")&&(p=a(this.entities.arguments))&&a(")");if(f.length>0&&(a(";")||j("}")))return new m.mixin.Call(f,p,K)}},definition:function(){var f,k=[],l,p;if(!(h.charAt(i)!=="."&&h.charAt(i)!=="#"||j(/^[^{]*(;|})/)))if(f=a(/^([#.][\w-]+)\s*\(/)){for(f=f[1];l= +a(this.entities.variable)||a(this.entities.literal)||a(this.entities.keyword);){if(l instanceof m.Variable)if(a(":"))if(p=a(this.expression))k.push({name:l.name,value:p});else throw new Error("Expected value");else k.push({name:l.name});else k.push({value:l});if(!a(","))break}if(!a(")"))throw new Error("Expected )");if(l=a(this.block))return new m.mixin.Definition(f,k,l)}}},entity:function(){return a(this.entities.literal)||a(this.entities.variable)||a(this.entities.url)||a(this.entities.call)||a(this.entities.keyword)|| +a(this.entities.javascript)},end:function(){return a(";")||j("}")},alpha:function(){var f;if(a(/^opacity=/i))if(f=a(/^\d+/)||a(this.entities.variable)){if(!a(")"))throw new Error("missing closing ) for alpha()");return new m.Alpha(f)}},element:function(){var f;c=a(this.combinator);if(f=a(/^[.#:]?[\w-]+/)||a("*")||a(this.attribute)||a(/^\([^)@]+\)/))return new m.Element(c,f)},combinator:function(){var f=h.charAt(i);if(f===">"||f==="&"||f==="+"||f==="~"){for(i++;h.charAt(i)===" ";)i++;return new m.Combinator(f)}else if(f=== +":"&&h.charAt(i+1)===":"){for(i+=2;h.charAt(i)===" ";)i++;return new m.Combinator("::")}else return h.charAt(i-1)===" "?new m.Combinator(" "):new m.Combinator(null)},selector:function(){for(var f,k=[],l;f=a(this.element);){l=h.charAt(i);k.push(f);if(l==="{"||l==="}"||l===";"||l===",")break}if(k.length>0)return new m.Selector(k)},tag:function(){return a(/^[a-zA-Z][a-zA-Z-]*[0-9]?/)||a("*")},attribute:function(){var f="",k,l,p;if(a("[")){if(k=a(/^[a-z-]+/)||a(this.entities.quoted))f=(p=a(/^[|~*$^]?=/))&& +(l=a(this.entities.quoted)||a(/^[\w-]+/))?[k,p,l.toCSS?l.toCSS():l].join(""):k;if(a("]"))if(f)return"["+f+"]"}},block:function(){var f;if(a("{")&&(f=a(this.primary))&&a("}"))return f},ruleset:function(){var f=[],k,l;b();if(k=/^([.#: \w-]+)[\s\n]*\{/.exec(v[n])){i+=k[0].length-1;f=[new m.Selector([new m.Element(null,k[1])])]}else{for(;k=a(this.selector);){f.push(k);if(!a(","))break}k&&a(this.comment)}if(f.length>0&&(l=a(this.block)))return new m.Ruleset(f,l);else{u=i;e()}},rule:function(){var f;f= +h.charAt(i);var k;b();if(!(f==="."||f==="#"||f==="&"))if(name=a(this.variable)||a(this.property)){if(name.charAt(0)!="@"&&(match=/^([^@+\/'"*`(;{}-]*);/.exec(v[n]))){i+=match[0].length-1;f=new m.Anonymous(match[1])}else f=name==="font"?a(this.font):a(this.value);k=a(this.important);if(f&&a(this.end))return new m.Rule(name,f,k,x);else{u=i;e()}}},"import":function(){var f;if(a(/^@import\s+/)&&(f=a(this.entities.quoted)||a(this.entities.url))&&a(";"))return new m.Import(f,Y)},directive:function(){var f, +k,l;if(h.charAt(i)==="@")if(k=a(this["import"]))return k;else if(f=a(/^@media|@page/)){l=a(/^[^{]+/).trim();if(k=a(this.block))return new m.Directive(f+" "+l,k)}else if(f=a(/^@[-a-z]+/))if(f==="@font-face"){if(k=a(this.block))return new m.Directive(f,k)}else if((k=a(this.entity))&&a(";"))return new m.Directive(f,k)},font:function(){for(var f=[],k=[],l;l=a(this.shorthand)||a(this.entity);)k.push(l);f.push(new m.Expression(k));if(a(","))for(;l=a(this.expression);){f.push(l);if(!a(","))break}return new m.Value(f)}, +value:function(){for(var f,k=[];f=a(this.expression);){k.push(f);if(!a(","))break}if(k.length>0)return new m.Value(k)},important:function(){if(h.charAt(i)==="!")return a(/^! *important/)},sub:function(){var f;if(a("(")&&(f=a(this.expression))&&a(")"))return f},multiplication:function(){var f,k,l,p;if(f=a(this.operand)){for(;(l=a("/")||a("*"))&&(k=a(this.operand));)p=new m.Operation(l,[p||f,k]);return p||f}},addition:function(){var f,k,l,p;if(f=a(this.multiplication)){for(;(l=a(/^[-+]\s+/)||h.charAt(i- +1)!=" "&&(a("+")||a("-")))&&(k=a(this.multiplication));)p=new m.Operation(l,[p||f,k]);return p||f}},operand:function(){return a(this.sub)||a(this.entities.dimension)||a(this.entities.color)||a(this.entities.variable)||a(this.entities.call)},expression:function(){for(var f,k=[];f=a(this.addition)||a(this.entity);)k.push(f);if(k.length>0)return new m.Expression(k)},property:function(){var f;if(f=a(/^(\*?-?[-a-z_0-9]+)\s*:/))return f[1]}}}};if(typeof E!=="undefined")o.Parser.importer=function(d,b,e){if(d.charAt(0)!== +"/"&&b.length>0)d=b[0]+d;U({href:d,title:d},e,true)};(function(d){function b(a){return d.functions.hsla(a.h,a.s,a.l,a.a)}function e(a){if(a instanceof d.Dimension)return parseFloat(a.unit=="%"?a.value/100:a.value);else if(typeof a==="number")return a;else throw{error:"RuntimeError",message:"color functions take numbers as parameters"};}function g(a){return Math.min(1,Math.max(0,a))}d.functions={rgb:function(a,j,h){return this.rgba(a,j,h,1)},rgba:function(a,j,h,i){a=[a,j,h].map(function(n){return e(n)}); +i=e(i);return new d.Color(a,i)},hsl:function(a,j,h){return this.hsla(a,j,h,1)},hsla:function(a,j,h,i){function n(u){u=u<0?u+1:u>1?u-1:u;return u*6<1?x+(r-x)*u*6:u*2<1?r:u*3<2?x+(r-x)*(2/3-u)*6:x}a=e(a)%360/360;j=e(j);h=e(h);i=e(i);var r=h<=0.5?h*(j+1):h+j-h*j,x=h*2-r;return this.rgba(n(a+1/3)*255,n(a)*255,n(a-1/3)*255,i)},hue:function(a){return new d.Dimension(Math.round(a.toHSL().h))},saturation:function(a){return new d.Dimension(Math.round(a.toHSL().s*100),"%")},lightness:function(a){return new d.Dimension(Math.round(a.toHSL().l* +100),"%")},alpha:function(a){return new d.Dimension(a.toHSL().a)},saturate:function(a,j){a=a.toHSL();a.s+=j.value/100;a.s=g(a.s);return b(a)},desaturate:function(a,j){a=a.toHSL();a.s-=j.value/100;a.s=g(a.s);return b(a)},lighten:function(a,j){a=a.toHSL();a.l+=j.value/100;a.l=g(a.l);return b(a)},darken:function(a,j){a=a.toHSL();a.l-=j.value/100;a.l=g(a.l);return b(a)},spin:function(a,j){a=a.toHSL();j=(a.h+j.value)%360;a.h=j<0?360+j:j;return b(a)},greyscale:function(a){return this.desaturate(a,new d.Dimension(100))}, +e:function(a){return new d.Anonymous(a instanceof d.JavaScript?a.evaluated:a)},"%":function(a){for(var j=Array.prototype.slice.call(arguments,1),h=a.content,i=0;i255?255:b<0?0:b).toString(16);return b.length===1?"0"+ +b:b}).join("")},operate:function(b,e){var g=[];e instanceof d.Color||(e=e.toColor());for(var a=0;a<3;a++)g[a]=d.operate(b,this.rgb[a],e.rgb[a]);return new d.Color(g)},toHSL:function(){var b=this.rgb[0]/255,e=this.rgb[1]/255,g=this.rgb[2]/255,a=this.alpha,j=Math.max(b,e,g),h=Math.min(b,e,g),i,n=(j+h)/2,r=j-h;if(j===h)i=h=0;else{h=n>0.5?r/(2-j-h):r/(j+h);switch(j){case b:i=(e-g)/r+(e":b.compress?">":" > "}[this.value]}})(q("less/tree"));(function(d){d.Expression=function(b){this.value=b};d.Expression.prototype={eval:function(b){return this.value.length>1?new d.Expression(this.value.map(function(e){return e.eval(b)})):this.value[0].eval(b)},toCSS:function(b){return this.value.map(function(e){return e.toCSS(b)}).join(" ")}}})(q("less/tree")); +(function(d){d.Import=function(b,e){var g=this;this._path=b;this.path=b instanceof d.Quoted?/\.(le?|c)ss$/.test(b.content)?b.content:b.content+".less":b.value.content||b.value;(this.css=/css$/.test(this.path))||e.push(this.path,function(a){if(!a)throw new Error("Error parsing "+g.path);g.root=a})};d.Import.prototype={toCSS:function(){return this.css?"@import "+this._path.toCSS()+";\n":""},eval:function(b){var e;if(this.css)return this;else{e=new d.Ruleset(null,this.root.rules.slice(0));for(var g= +0;g0){for(j=0;j1?Array.prototype.push.apply(g,j.find(new d.Selector(b.elements.slice(1)),e)):g.push(j);break}});return this._lookups[a]= +g},toCSS:function(b,e){var g=[],a=[],j=[],h=[];if(!this.root)if(b.length===0)h=this.selectors.map(function(r){return[r]});else for(var i=0;i0){h=h.map(function(r){return r.map(function(x){return x.toCSS(e)}).join("").trim()}).join(e.compress?",":h.length>3?",\n":", ");g.push(h,(e.compress?"{":" {\n ")+a.join(e.compress?"":"\n ")+(e.compress?"}":"\n}\n"))}g.push(j);return g.join("")+(e.compress?"\n":"")}}})(q("less/tree"));(function(d){d.Selector=function(b){this.elements=b;if(this.elements[0].combinator.value==="")this.elements[0].combinator.value= +" "};d.Selector.prototype.match=function(b){return this.elements[0].value===b.elements[0].value?true:false};d.Selector.prototype.toCSS=function(b){if(this._css)return this._css;return this._css=this.elements.map(function(e){return typeof e==="string"?" "+e.trim():e.toCSS(b)}).join("")}})(q("less/tree"));(function(d){d.URL=function(b){this.value=b};d.URL.prototype={toCSS:function(){return"url("+this.value.toCSS()+")"},eval:function(b){this.value=this.value.eval(b);return this}}})(q("less/tree"));(function(d){d.Value= +function(b){this.value=b;this.is="value"};d.Value.prototype={eval:function(b){return this.value.length===1?this.value[0].eval(b):new d.Value(this.value.map(function(e){return e.eval(b)}))},toCSS:function(b){return this.value.map(function(e){return e.toCSS(b)}).join(b.compress?",":", ")}}})(q("less/tree"));(function(d){d.Variable=function(b,e){this.name=b;this.index=e};d.Variable.prototype={eval:function(b){var e,g,a=this.name;if(e=d.find(b.frames,function(j){if(g=j.variable(a))return g.value.eval(b)}))return e; +else throw{message:"variable "+this.name+" is undefined",index:this.index};}}})(q("less/tree"));q("less/tree").find=function(d,b){for(var e=0,g;e0||O?"development":"production";o.async=false;o.poll=O?1E3:1500;o.watch=function(){return this.watchMode= +true};o.unwatch=function(){return this.watchMode=false};if(o.env==="development"){o.optimization=0;/!watch/.test(location.hash)&&o.watch();o.watchTimer=setInterval(function(){o.watchMode&&T(function(d,b,e){d&&N(d.toCSS(),b,e.lastModified)})},o.poll)}else o.optimization=3;var C;try{C=typeof E.localStorage==="undefined"?null:E.localStorage}catch(ca){C=null}var M=document.getElementsByTagName("link"),S=/^text\/(x-)?less$/;o.sheets=[];for(var J=0;J