mirror of
https://github.com/less/less.js.git
synced 2026-05-01 03:00:22 -04:00
Allow any casing for functions. Fixes #1168
This commit is contained in:
@@ -25,13 +25,14 @@ tree.Call.prototype = {
|
||||
// The function should receive the value, not the variable.
|
||||
//
|
||||
eval: function (env) {
|
||||
var args = this.args.map(function (a) { return a.eval(env) }),
|
||||
var args = this.args.map(function (a) { return a.eval(env); }),
|
||||
nameLC = this.name.toLowerCase(),
|
||||
result, func;
|
||||
|
||||
if (this.name in tree.functions) { // 1.
|
||||
if (nameLC in tree.functions) { // 1.
|
||||
try {
|
||||
func = new tree.functionCall(env, this.rootpath);
|
||||
result = func[this.name].apply(func, args);
|
||||
result = func[nameLC].apply(func, args);
|
||||
if (result != null) {
|
||||
return result;
|
||||
}
|
||||
@@ -45,7 +46,7 @@ tree.Call.prototype = {
|
||||
|
||||
// 2.
|
||||
return new(tree.Anonymous)(this.name +
|
||||
"(" + args.map(function (a) { return a.toCSS(env) }).join(', ') + ")");
|
||||
"(" + args.map(function (a) { return a.toCSS(env); }).join(', ') + ")");
|
||||
},
|
||||
|
||||
toCSS: function (env) {
|
||||
|
||||
@@ -87,6 +87,8 @@
|
||||
shade: #686868;
|
||||
shade-full: #000000;
|
||||
shade-percent: #686868;
|
||||
fade-out: rgba(255, 0, 0, 0.95);
|
||||
fade-in: rgba(255, 0, 0, 0.9500000000000001);
|
||||
hsv: #4d2926;
|
||||
hsva: rgba(77, 40, 38, 0.2);
|
||||
mix: #ff3300;
|
||||
|
||||
@@ -93,6 +93,9 @@
|
||||
shade: shade(#777777, 13);
|
||||
shade-full: shade(#777777, 100);
|
||||
shade-percent: shade(#777777, 13%);
|
||||
|
||||
fade-out: fadeOut(red, 5%); // support fadeOut and fadeout
|
||||
fade-in: fadein(fadeout(red, 10%), 5%);
|
||||
|
||||
hsv: hsv(5, 50%, 30%);
|
||||
hsva: hsva(3, 50%, 30%, 0.2);
|
||||
|
||||
Reference in New Issue
Block a user