less 4.1.1 → 4.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +2 -1
- package/.eslintrc.json +70 -2
- package/Gruntfile.js +6 -11
- package/dist/less.js +165 -102
- package/dist/less.min.js +2 -2
- package/dist/less.min.js.map +1 -1
- package/lib/less/functions/function-caller.js +5 -1
- package/lib/less/functions/function-caller.js.map +1 -1
- package/lib/less/functions/types.js +2 -1
- package/lib/less/functions/types.js.map +1 -1
- package/lib/less/tree/index.js +34 -7
- package/lib/less/tree/index.js.map +1 -1
- package/lib/less/tree/js-eval-node.js +4 -2
- package/lib/less/tree/js-eval-node.js.map +1 -1
- package/lib/less/tree/mixin-call.js +9 -3
- package/lib/less/tree/mixin-call.js.map +1 -1
- package/lib/less/tree/namespace-value.js +6 -2
- package/lib/less/tree/namespace-value.js.map +1 -1
- package/lib/less/tree/node.js +14 -7
- package/lib/less/tree/node.js.map +1 -1
- package/lib/less/tree/property.js +6 -2
- package/lib/less/tree/property.js.map +1 -1
- package/lib/less/tree/variable.js +6 -2
- package/lib/less/tree/variable.js.map +1 -1
- package/lib/less/visitors/to-css-visitor.js +4 -2
- package/lib/less/visitors/to-css-visitor.js.map +1 -1
- package/lib/less-node/url-file-manager.js +1 -1
- package/lib/less-node/url-file-manager.js.map +1 -1
- package/package.json +10 -9
- package/tsconfig.json +5 -0
package/dist/less.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Less - Leaner CSS v4.1.
|
|
2
|
+
* Less - Leaner CSS v4.1.2
|
|
3
3
|
* http://lesscss.org
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2009-2021, Alexis Sellier <self@cloudhead.net>
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
}
|
|
192
192
|
});
|
|
193
193
|
|
|
194
|
-
var logger = {
|
|
194
|
+
var logger$1 = {
|
|
195
195
|
error: function (msg) {
|
|
196
196
|
this._fireEvent('error', msg);
|
|
197
197
|
},
|
|
@@ -250,10 +250,10 @@
|
|
|
250
250
|
}
|
|
251
251
|
Environment.prototype.getFileManager = function (filename, currentDirectory, options, environment, isSync) {
|
|
252
252
|
if (!filename) {
|
|
253
|
-
logger.warn('getFileManager called with no filename.. Please report this issue. continuing.');
|
|
253
|
+
logger$1.warn('getFileManager called with no filename.. Please report this issue. continuing.');
|
|
254
254
|
}
|
|
255
255
|
if (currentDirectory == null) {
|
|
256
|
-
logger.warn('getFileManager called with null directory.. Please report this issue. continuing.');
|
|
256
|
+
logger$1.warn('getFileManager called with null directory.. Please report this issue. continuing.');
|
|
257
257
|
}
|
|
258
258
|
var fileManagers = this.fileManagers;
|
|
259
259
|
if (options.pluginManager) {
|
|
@@ -464,14 +464,21 @@
|
|
|
464
464
|
this.nodeVisible = undefined;
|
|
465
465
|
this.rootNode = null;
|
|
466
466
|
this.parsed = null;
|
|
467
|
-
var self = this;
|
|
468
|
-
Object.defineProperty(this, 'currentFileInfo', {
|
|
469
|
-
get: function () { return self.fileInfo(); }
|
|
470
|
-
});
|
|
471
|
-
Object.defineProperty(this, 'index', {
|
|
472
|
-
get: function () { return self.getIndex(); }
|
|
473
|
-
});
|
|
474
467
|
}
|
|
468
|
+
Object.defineProperty(Node.prototype, "currentFileInfo", {
|
|
469
|
+
get: function () {
|
|
470
|
+
return this.fileInfo();
|
|
471
|
+
},
|
|
472
|
+
enumerable: false,
|
|
473
|
+
configurable: true
|
|
474
|
+
});
|
|
475
|
+
Object.defineProperty(Node.prototype, "index", {
|
|
476
|
+
get: function () {
|
|
477
|
+
return this.getIndex();
|
|
478
|
+
},
|
|
479
|
+
enumerable: false,
|
|
480
|
+
configurable: true
|
|
481
|
+
});
|
|
475
482
|
Node.prototype.setParent = function (nodes, parent) {
|
|
476
483
|
function set(node) {
|
|
477
484
|
if (node && node instanceof Node) {
|
|
@@ -703,11 +710,11 @@
|
|
|
703
710
|
switch (colorFunction) {
|
|
704
711
|
case 'rgba':
|
|
705
712
|
args = this.rgb.map(function (c) {
|
|
706
|
-
return clamp(Math.round(c), 255);
|
|
707
|
-
}).concat(clamp(alpha, 1));
|
|
713
|
+
return clamp$1(Math.round(c), 255);
|
|
714
|
+
}).concat(clamp$1(alpha, 1));
|
|
708
715
|
break;
|
|
709
716
|
case 'hsla':
|
|
710
|
-
args.push(clamp(alpha, 1));
|
|
717
|
+
args.push(clamp$1(alpha, 1));
|
|
711
718
|
case 'hsl':
|
|
712
719
|
color = this.toHSL();
|
|
713
720
|
args = [
|
|
@@ -832,12 +839,12 @@
|
|
|
832
839
|
return c;
|
|
833
840
|
}
|
|
834
841
|
};
|
|
835
|
-
function clamp(v, max) {
|
|
842
|
+
function clamp$1(v, max) {
|
|
836
843
|
return Math.min(Math.max(v, 0), max);
|
|
837
844
|
}
|
|
838
845
|
function toHex(v) {
|
|
839
846
|
return "#" + v.map(function (c) {
|
|
840
|
-
c = clamp(Math.round(c), 255);
|
|
847
|
+
c = clamp$1(Math.round(c), 255);
|
|
841
848
|
return (c < 16 ? '0' : '') + c.toString(16);
|
|
842
849
|
}).join('');
|
|
843
850
|
}
|
|
@@ -1507,7 +1514,7 @@
|
|
|
1507
1514
|
}
|
|
1508
1515
|
});
|
|
1509
1516
|
|
|
1510
|
-
var MATH = Math$1;
|
|
1517
|
+
var MATH$1 = Math$1;
|
|
1511
1518
|
function evalName(context, name) {
|
|
1512
1519
|
var value = '';
|
|
1513
1520
|
var i;
|
|
@@ -1555,10 +1562,10 @@
|
|
|
1555
1562
|
variable = false; // never treat expanded interpolation as new variable name
|
|
1556
1563
|
}
|
|
1557
1564
|
// @todo remove when parens-division is default
|
|
1558
|
-
if (name === 'font' && context.math === MATH.ALWAYS) {
|
|
1565
|
+
if (name === 'font' && context.math === MATH$1.ALWAYS) {
|
|
1559
1566
|
mathBypass = true;
|
|
1560
1567
|
prevMath = context.math;
|
|
1561
|
-
context.math = MATH.PARENS_DIVISION;
|
|
1568
|
+
context.math = MATH$1.PARENS_DIVISION;
|
|
1562
1569
|
}
|
|
1563
1570
|
try {
|
|
1564
1571
|
context.importantScope.push({});
|
|
@@ -2985,7 +2992,7 @@
|
|
|
2985
2992
|
}
|
|
2986
2993
|
});
|
|
2987
2994
|
|
|
2988
|
-
var MATH
|
|
2995
|
+
var MATH = Math$1;
|
|
2989
2996
|
var Operation = function (op, operands, isSpaced) {
|
|
2990
2997
|
this.op = op.trim();
|
|
2991
2998
|
this.operands = operands;
|
|
@@ -3008,7 +3015,7 @@
|
|
|
3008
3015
|
}
|
|
3009
3016
|
if (!a.operate || !b.operate) {
|
|
3010
3017
|
if ((a instanceof Operation || b instanceof Operation)
|
|
3011
|
-
&& a.op === '/' && context.math === MATH
|
|
3018
|
+
&& a.op === '/' && context.math === MATH.PARENS_DIVISION) {
|
|
3012
3019
|
return new Operation(this.op, [a, b], this.isSpaced);
|
|
3013
3020
|
}
|
|
3014
3021
|
throw { type: 'Operation',
|
|
@@ -3048,12 +3055,14 @@
|
|
|
3048
3055
|
PERFORMANCE OF THIS SOFTWARE.
|
|
3049
3056
|
***************************************************************************** */
|
|
3050
3057
|
|
|
3051
|
-
function
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3058
|
+
function __spreadArray(to, from, pack) {
|
|
3059
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3060
|
+
if (ar || !(i in from)) {
|
|
3061
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
3062
|
+
ar[i] = from[i];
|
|
3063
|
+
}
|
|
3064
|
+
}
|
|
3065
|
+
return to.concat(ar || from);
|
|
3057
3066
|
}
|
|
3058
3067
|
|
|
3059
3068
|
var Expression = function (value, noSpacing) {
|
|
@@ -3146,6 +3155,10 @@
|
|
|
3146
3155
|
if (item.type === 'Expression') {
|
|
3147
3156
|
var subNodes = item.value.filter(commentFilter);
|
|
3148
3157
|
if (subNodes.length === 1) {
|
|
3158
|
+
// https://github.com/less/less.js/issues/3616
|
|
3159
|
+
if (item.parens && subNodes[0].op === '/') {
|
|
3160
|
+
return item;
|
|
3161
|
+
}
|
|
3149
3162
|
return subNodes[0];
|
|
3150
3163
|
}
|
|
3151
3164
|
else {
|
|
@@ -3155,7 +3168,7 @@
|
|
|
3155
3168
|
return item;
|
|
3156
3169
|
});
|
|
3157
3170
|
if (evalArgs === false) {
|
|
3158
|
-
return this.func.apply(this,
|
|
3171
|
+
return this.func.apply(this, __spreadArray([this.context], args));
|
|
3159
3172
|
}
|
|
3160
3173
|
return this.func.apply(this, args);
|
|
3161
3174
|
};
|
|
@@ -3271,7 +3284,9 @@
|
|
|
3271
3284
|
name = "@" + new Variable(name.slice(1), this.getIndex(), this.fileInfo()).eval(context).value;
|
|
3272
3285
|
}
|
|
3273
3286
|
if (this.evaluating) {
|
|
3274
|
-
throw { type: 'Name',
|
|
3287
|
+
throw { type: 'Name',
|
|
3288
|
+
message: "Recursive variable definition for " + name,
|
|
3289
|
+
filename: this.fileInfo().filename,
|
|
3275
3290
|
index: this.getIndex() };
|
|
3276
3291
|
}
|
|
3277
3292
|
this.evaluating = true;
|
|
@@ -3296,7 +3311,9 @@
|
|
|
3296
3311
|
return variable;
|
|
3297
3312
|
}
|
|
3298
3313
|
else {
|
|
3299
|
-
throw { type: 'Name',
|
|
3314
|
+
throw { type: 'Name',
|
|
3315
|
+
message: "variable " + name + " is undefined",
|
|
3316
|
+
filename: this.fileInfo().filename,
|
|
3300
3317
|
index: this.getIndex() };
|
|
3301
3318
|
}
|
|
3302
3319
|
},
|
|
@@ -3324,7 +3341,9 @@
|
|
|
3324
3341
|
// TODO: shorten this reference
|
|
3325
3342
|
var mergeRules = context.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules;
|
|
3326
3343
|
if (this.evaluating) {
|
|
3327
|
-
throw { type: 'Name',
|
|
3344
|
+
throw { type: 'Name',
|
|
3345
|
+
message: "Recursive property reference for " + name,
|
|
3346
|
+
filename: this.fileInfo().filename,
|
|
3328
3347
|
index: this.getIndex() };
|
|
3329
3348
|
}
|
|
3330
3349
|
this.evaluating = true;
|
|
@@ -3351,7 +3370,9 @@
|
|
|
3351
3370
|
return property;
|
|
3352
3371
|
}
|
|
3353
3372
|
else {
|
|
3354
|
-
throw { type: 'Name',
|
|
3373
|
+
throw { type: 'Name',
|
|
3374
|
+
message: "Property '" + name + "' is undefined",
|
|
3375
|
+
filename: this.currentFileInfo.filename,
|
|
3355
3376
|
index: this.index };
|
|
3356
3377
|
}
|
|
3357
3378
|
},
|
|
@@ -3799,7 +3820,8 @@
|
|
|
3799
3820
|
expression = new Function("return (" + expression + ")");
|
|
3800
3821
|
}
|
|
3801
3822
|
catch (e) {
|
|
3802
|
-
throw { message: "JavaScript evaluation error: " + e.message + " from `" + expression + "`",
|
|
3823
|
+
throw { message: "JavaScript evaluation error: " + e.message + " from `" + expression + "`",
|
|
3824
|
+
filename: this.fileInfo().filename,
|
|
3803
3825
|
index: this.getIndex() };
|
|
3804
3826
|
}
|
|
3805
3827
|
var variables = context.frames[0].variables();
|
|
@@ -3818,7 +3840,8 @@
|
|
|
3818
3840
|
result = expression.call(evalContext);
|
|
3819
3841
|
}
|
|
3820
3842
|
catch (e) {
|
|
3821
|
-
throw { message: "JavaScript evaluation error: '" + e.name + ": " + e.message.replace(/["]/g, '\'') + "'",
|
|
3843
|
+
throw { message: "JavaScript evaluation error: '" + e.name + ": " + e.message.replace(/["]/g, '\'') + "'",
|
|
3844
|
+
filename: this.fileInfo().filename,
|
|
3822
3845
|
index: this.getIndex() };
|
|
3823
3846
|
}
|
|
3824
3847
|
return result;
|
|
@@ -4059,7 +4082,9 @@
|
|
|
4059
4082
|
rules = rules.variable(name);
|
|
4060
4083
|
}
|
|
4061
4084
|
if (!rules) {
|
|
4062
|
-
throw { type: 'Name',
|
|
4085
|
+
throw { type: 'Name',
|
|
4086
|
+
message: "variable " + name + " not found",
|
|
4087
|
+
filename: this.fileInfo().filename,
|
|
4063
4088
|
index: this.getIndex() };
|
|
4064
4089
|
}
|
|
4065
4090
|
}
|
|
@@ -4074,7 +4099,9 @@
|
|
|
4074
4099
|
rules = rules.property(name);
|
|
4075
4100
|
}
|
|
4076
4101
|
if (!rules) {
|
|
4077
|
-
throw { type: 'Name',
|
|
4102
|
+
throw { type: 'Name',
|
|
4103
|
+
message: "property \"" + name.substr(1) + "\" not found",
|
|
4104
|
+
filename: this.fileInfo().filename,
|
|
4078
4105
|
index: this.getIndex() };
|
|
4079
4106
|
}
|
|
4080
4107
|
// Properties are an array of values, since a ruleset can have multiple props.
|
|
@@ -4415,7 +4442,9 @@
|
|
|
4415
4442
|
else {
|
|
4416
4443
|
defaultResult = defTrue;
|
|
4417
4444
|
if ((count[defTrue] + count[defFalse]) > 1) {
|
|
4418
|
-
throw { type: 'Runtime',
|
|
4445
|
+
throw { type: 'Runtime',
|
|
4446
|
+
message: "Ambiguous use of `default()` found when matching for `" + this.format(args) + "`",
|
|
4447
|
+
index: this.getIndex(), filename: this.fileInfo().filename };
|
|
4419
4448
|
}
|
|
4420
4449
|
}
|
|
4421
4450
|
for (m = 0; m < candidates.length; m++) {
|
|
@@ -4443,10 +4472,14 @@
|
|
|
4443
4472
|
}
|
|
4444
4473
|
}
|
|
4445
4474
|
if (isOneFound) {
|
|
4446
|
-
throw { type: 'Runtime',
|
|
4475
|
+
throw { type: 'Runtime',
|
|
4476
|
+
message: "No matching definition was found for `" + this.format(args) + "`",
|
|
4477
|
+
index: this.getIndex(), filename: this.fileInfo().filename };
|
|
4447
4478
|
}
|
|
4448
4479
|
else {
|
|
4449
|
-
throw { type: 'Name',
|
|
4480
|
+
throw { type: 'Name',
|
|
4481
|
+
message: this.selector.toCSS().trim() + " is undefined",
|
|
4482
|
+
index: this.getIndex(), filename: this.fileInfo().filename };
|
|
4450
4483
|
}
|
|
4451
4484
|
},
|
|
4452
4485
|
_setVisibilityToReplacement: function (replacement) {
|
|
@@ -4476,13 +4509,40 @@
|
|
|
4476
4509
|
});
|
|
4477
4510
|
|
|
4478
4511
|
var tree = {
|
|
4479
|
-
Node: Node,
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4512
|
+
Node: Node,
|
|
4513
|
+
Color: Color,
|
|
4514
|
+
AtRule: AtRule,
|
|
4515
|
+
DetachedRuleset: DetachedRuleset,
|
|
4516
|
+
Operation: Operation,
|
|
4517
|
+
Dimension: Dimension,
|
|
4518
|
+
Unit: Unit,
|
|
4519
|
+
Keyword: Keyword,
|
|
4520
|
+
Variable: Variable,
|
|
4521
|
+
Property: Property,
|
|
4522
|
+
Ruleset: Ruleset,
|
|
4523
|
+
Element: Element,
|
|
4524
|
+
Attribute: Attribute,
|
|
4525
|
+
Combinator: Combinator,
|
|
4526
|
+
Selector: Selector,
|
|
4527
|
+
Quoted: Quoted,
|
|
4528
|
+
Expression: Expression,
|
|
4529
|
+
Declaration: Declaration,
|
|
4530
|
+
Call: Call,
|
|
4531
|
+
URL: URL,
|
|
4532
|
+
Import: Import,
|
|
4533
|
+
Comment: Comment,
|
|
4534
|
+
Anonymous: Anonymous,
|
|
4535
|
+
Value: Value,
|
|
4536
|
+
JavaScript: JavaScript,
|
|
4537
|
+
Assignment: Assignment,
|
|
4538
|
+
Condition: Condition,
|
|
4539
|
+
Paren: Paren,
|
|
4540
|
+
Media: Media,
|
|
4541
|
+
UnicodeDescriptor: UnicodeDescriptor,
|
|
4542
|
+
Negative: Negative,
|
|
4543
|
+
Extend: Extend,
|
|
4544
|
+
VariableCall: VariableCall,
|
|
4545
|
+
NamespaceValue: NamespaceValue,
|
|
4486
4546
|
mixin: {
|
|
4487
4547
|
Call: MixinCall,
|
|
4488
4548
|
Definition: Definition
|
|
@@ -5280,7 +5340,7 @@
|
|
|
5280
5340
|
catch (_) { }
|
|
5281
5341
|
if (!indices[extend.index + " " + selector]) {
|
|
5282
5342
|
indices[extend.index + " " + selector] = true;
|
|
5283
|
-
logger.warn("extend '" + selector + "' has no matches");
|
|
5343
|
+
logger$1.warn("extend '" + selector + "' has no matches");
|
|
5284
5344
|
}
|
|
5285
5345
|
});
|
|
5286
5346
|
};
|
|
@@ -5821,10 +5881,12 @@
|
|
|
5821
5881
|
index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename };
|
|
5822
5882
|
}
|
|
5823
5883
|
if (ruleNode instanceof tree.Call) {
|
|
5824
|
-
throw { message: "Function '" + ruleNode.name + "' did not return a root node",
|
|
5884
|
+
throw { message: "Function '" + ruleNode.name + "' did not return a root node",
|
|
5885
|
+
index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename };
|
|
5825
5886
|
}
|
|
5826
5887
|
if (ruleNode.type && !ruleNode.allowRoot) {
|
|
5827
|
-
throw { message: ruleNode.type + " node returned by a function is not valid here",
|
|
5888
|
+
throw { message: ruleNode.type + " node returned by a function is not valid here",
|
|
5889
|
+
index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename };
|
|
5828
5890
|
}
|
|
5829
5891
|
}
|
|
5830
5892
|
},
|
|
@@ -8714,7 +8776,7 @@
|
|
|
8714
8776
|
var boolean$1 = { isdefined: isdefined, boolean: boolean, 'if': If };
|
|
8715
8777
|
|
|
8716
8778
|
var colorFunctions;
|
|
8717
|
-
function clamp
|
|
8779
|
+
function clamp(val) {
|
|
8718
8780
|
return Math.min(1, Math.max(0, val));
|
|
8719
8781
|
}
|
|
8720
8782
|
function hsla(origColor, hsl) {
|
|
@@ -8746,7 +8808,7 @@
|
|
|
8746
8808
|
throw new Error('Argument cannot be evaluated to a color');
|
|
8747
8809
|
}
|
|
8748
8810
|
}
|
|
8749
|
-
function number(n) {
|
|
8811
|
+
function number$1(n) {
|
|
8750
8812
|
if (n instanceof Dimension) {
|
|
8751
8813
|
return parseFloat(n.unit.is('%') ? n.value / 100 : n.value);
|
|
8752
8814
|
}
|
|
@@ -8765,7 +8827,7 @@
|
|
|
8765
8827
|
return parseFloat(n.value * size / 100);
|
|
8766
8828
|
}
|
|
8767
8829
|
else {
|
|
8768
|
-
return number(n);
|
|
8830
|
+
return number$1(n);
|
|
8769
8831
|
}
|
|
8770
8832
|
}
|
|
8771
8833
|
colorFunctions = {
|
|
@@ -8800,7 +8862,7 @@
|
|
|
8800
8862
|
try {
|
|
8801
8863
|
if (r instanceof Color) {
|
|
8802
8864
|
if (g) {
|
|
8803
|
-
a = number(g);
|
|
8865
|
+
a = number$1(g);
|
|
8804
8866
|
}
|
|
8805
8867
|
else {
|
|
8806
8868
|
a = r.alpha;
|
|
@@ -8808,7 +8870,7 @@
|
|
|
8808
8870
|
return new Color(r.rgb, a, 'rgba');
|
|
8809
8871
|
}
|
|
8810
8872
|
var rgb = [r, g, b].map(function (c) { return scaled(c, 255); });
|
|
8811
|
-
a = number(a);
|
|
8873
|
+
a = number$1(a);
|
|
8812
8874
|
return new Color(rgb, a, 'rgba');
|
|
8813
8875
|
}
|
|
8814
8876
|
catch (e) { }
|
|
@@ -8836,7 +8898,7 @@
|
|
|
8836
8898
|
try {
|
|
8837
8899
|
if (h instanceof Color) {
|
|
8838
8900
|
if (s) {
|
|
8839
|
-
a = number(s);
|
|
8901
|
+
a = number$1(s);
|
|
8840
8902
|
}
|
|
8841
8903
|
else {
|
|
8842
8904
|
a = h.alpha;
|
|
@@ -8860,10 +8922,10 @@
|
|
|
8860
8922
|
return m1_1;
|
|
8861
8923
|
}
|
|
8862
8924
|
}
|
|
8863
|
-
h = (number(h) % 360) / 360;
|
|
8864
|
-
s = clamp$1(
|
|
8865
|
-
l = clamp$1(
|
|
8866
|
-
a = clamp$1(
|
|
8925
|
+
h = (number$1(h) % 360) / 360;
|
|
8926
|
+
s = clamp(number$1(s));
|
|
8927
|
+
l = clamp(number$1(l));
|
|
8928
|
+
a = clamp(number$1(a));
|
|
8867
8929
|
m2_1 = l <= 0.5 ? l * (s + 1) : l + s - l * s;
|
|
8868
8930
|
m1_1 = l * 2 - m2_1;
|
|
8869
8931
|
var rgb = [
|
|
@@ -8871,7 +8933,7 @@
|
|
|
8871
8933
|
hue(h) * 255,
|
|
8872
8934
|
hue(h - 1 / 3) * 255
|
|
8873
8935
|
];
|
|
8874
|
-
a = number(a);
|
|
8936
|
+
a = number$1(a);
|
|
8875
8937
|
return new Color(rgb, a, 'hsla');
|
|
8876
8938
|
}
|
|
8877
8939
|
catch (e) { }
|
|
@@ -8880,10 +8942,10 @@
|
|
|
8880
8942
|
return colorFunctions.hsva(h, s, v, 1.0);
|
|
8881
8943
|
},
|
|
8882
8944
|
hsva: function (h, s, v, a) {
|
|
8883
|
-
h = ((number(h) % 360) / 360) * 360;
|
|
8884
|
-
s = number(s);
|
|
8885
|
-
v = number(v);
|
|
8886
|
-
a = number(a);
|
|
8945
|
+
h = ((number$1(h) % 360) / 360) * 360;
|
|
8946
|
+
s = number$1(s);
|
|
8947
|
+
v = number$1(v);
|
|
8948
|
+
a = number$1(a);
|
|
8887
8949
|
var i;
|
|
8888
8950
|
var f;
|
|
8889
8951
|
i = Math.floor((h / 60) % 6);
|
|
@@ -8952,7 +9014,7 @@
|
|
|
8952
9014
|
else {
|
|
8953
9015
|
hsl.s += amount.value / 100;
|
|
8954
9016
|
}
|
|
8955
|
-
hsl.s = clamp
|
|
9017
|
+
hsl.s = clamp(hsl.s);
|
|
8956
9018
|
return hsla(color, hsl);
|
|
8957
9019
|
},
|
|
8958
9020
|
desaturate: function (color, amount, method) {
|
|
@@ -8963,7 +9025,7 @@
|
|
|
8963
9025
|
else {
|
|
8964
9026
|
hsl.s -= amount.value / 100;
|
|
8965
9027
|
}
|
|
8966
|
-
hsl.s = clamp
|
|
9028
|
+
hsl.s = clamp(hsl.s);
|
|
8967
9029
|
return hsla(color, hsl);
|
|
8968
9030
|
},
|
|
8969
9031
|
lighten: function (color, amount, method) {
|
|
@@ -8974,7 +9036,7 @@
|
|
|
8974
9036
|
else {
|
|
8975
9037
|
hsl.l += amount.value / 100;
|
|
8976
9038
|
}
|
|
8977
|
-
hsl.l = clamp
|
|
9039
|
+
hsl.l = clamp(hsl.l);
|
|
8978
9040
|
return hsla(color, hsl);
|
|
8979
9041
|
},
|
|
8980
9042
|
darken: function (color, amount, method) {
|
|
@@ -8985,7 +9047,7 @@
|
|
|
8985
9047
|
else {
|
|
8986
9048
|
hsl.l -= amount.value / 100;
|
|
8987
9049
|
}
|
|
8988
|
-
hsl.l = clamp
|
|
9050
|
+
hsl.l = clamp(hsl.l);
|
|
8989
9051
|
return hsla(color, hsl);
|
|
8990
9052
|
},
|
|
8991
9053
|
fadein: function (color, amount, method) {
|
|
@@ -8996,7 +9058,7 @@
|
|
|
8996
9058
|
else {
|
|
8997
9059
|
hsl.a += amount.value / 100;
|
|
8998
9060
|
}
|
|
8999
|
-
hsl.a = clamp
|
|
9061
|
+
hsl.a = clamp(hsl.a);
|
|
9000
9062
|
return hsla(color, hsl);
|
|
9001
9063
|
},
|
|
9002
9064
|
fadeout: function (color, amount, method) {
|
|
@@ -9007,13 +9069,13 @@
|
|
|
9007
9069
|
else {
|
|
9008
9070
|
hsl.a -= amount.value / 100;
|
|
9009
9071
|
}
|
|
9010
|
-
hsl.a = clamp
|
|
9072
|
+
hsl.a = clamp(hsl.a);
|
|
9011
9073
|
return hsla(color, hsl);
|
|
9012
9074
|
},
|
|
9013
9075
|
fade: function (color, amount) {
|
|
9014
9076
|
var hsl = toHSL(color);
|
|
9015
9077
|
hsl.a = amount.value / 100;
|
|
9016
|
-
hsl.a = clamp
|
|
9078
|
+
hsl.a = clamp(hsl.a);
|
|
9017
9079
|
return hsla(color, hsl);
|
|
9018
9080
|
},
|
|
9019
9081
|
spin: function (color, amount) {
|
|
@@ -9066,7 +9128,7 @@
|
|
|
9066
9128
|
threshold = 0.43;
|
|
9067
9129
|
}
|
|
9068
9130
|
else {
|
|
9069
|
-
threshold = number(threshold);
|
|
9131
|
+
threshold = number$1(threshold);
|
|
9070
9132
|
}
|
|
9071
9133
|
if (color.luma() < threshold) {
|
|
9072
9134
|
return light;
|
|
@@ -9205,9 +9267,9 @@
|
|
|
9205
9267
|
return 1 - Math.abs(cb + cs - 1);
|
|
9206
9268
|
}
|
|
9207
9269
|
};
|
|
9208
|
-
for (var f in colorBlendModeFunctions) {
|
|
9209
|
-
if (colorBlendModeFunctions.hasOwnProperty(f)) {
|
|
9210
|
-
colorBlend[f] = colorBlend.bind(null, colorBlendModeFunctions[f]);
|
|
9270
|
+
for (var f$1 in colorBlendModeFunctions) {
|
|
9271
|
+
if (colorBlendModeFunctions.hasOwnProperty(f$1)) {
|
|
9272
|
+
colorBlend[f$1] = colorBlend.bind(null, colorBlendModeFunctions[f$1]);
|
|
9211
9273
|
}
|
|
9212
9274
|
}
|
|
9213
9275
|
|
|
@@ -9256,7 +9318,7 @@
|
|
|
9256
9318
|
}
|
|
9257
9319
|
var fileSync = fileManager.loadFileSync(filePath, currentDirectory, context, environment);
|
|
9258
9320
|
if (!fileSync.contents) {
|
|
9259
|
-
logger.warn("Skipped data-uri embedding of " + filePath + " because file not found");
|
|
9321
|
+
logger$1.warn("Skipped data-uri embedding of " + filePath + " because file not found");
|
|
9260
9322
|
return fallback(this, filePathNode || mimetypeNode);
|
|
9261
9323
|
}
|
|
9262
9324
|
var buf = fileSync.contents;
|
|
@@ -9427,9 +9489,9 @@
|
|
|
9427
9489
|
asin: 'rad',
|
|
9428
9490
|
acos: 'rad'
|
|
9429
9491
|
};
|
|
9430
|
-
for (var f
|
|
9431
|
-
if (mathFunctions.hasOwnProperty(f
|
|
9432
|
-
mathFunctions[f
|
|
9492
|
+
for (var f in mathFunctions) {
|
|
9493
|
+
if (mathFunctions.hasOwnProperty(f)) {
|
|
9494
|
+
mathFunctions[f] = MathHelper.bind(null, Math[f], mathFunctions[f]);
|
|
9433
9495
|
}
|
|
9434
9496
|
}
|
|
9435
9497
|
mathFunctions.round = function (n, f) {
|
|
@@ -9487,7 +9549,7 @@
|
|
|
9487
9549
|
args = order.map(function (a) { return a.toCSS(this.context); }).join(this.context.compress ? ',' : ', ');
|
|
9488
9550
|
return new Anonymous((isMin ? 'min' : 'max') + "(" + args + ")");
|
|
9489
9551
|
};
|
|
9490
|
-
var number
|
|
9552
|
+
var number = {
|
|
9491
9553
|
min: function () {
|
|
9492
9554
|
var args = [];
|
|
9493
9555
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -9687,7 +9749,8 @@
|
|
|
9687
9749
|
isunit: isunit,
|
|
9688
9750
|
unit: function (val, unit) {
|
|
9689
9751
|
if (!(val instanceof Dimension)) {
|
|
9690
|
-
throw { type: 'Argument',
|
|
9752
|
+
throw { type: 'Argument',
|
|
9753
|
+
message: "the first argument to unit must be a number" + (val instanceof Operation ? '. Have you forgotten parenthesis?' : '') };
|
|
9691
9754
|
}
|
|
9692
9755
|
if (unit) {
|
|
9693
9756
|
if (unit instanceof Keyword) {
|
|
@@ -9717,7 +9780,7 @@
|
|
|
9717
9780
|
functionRegistry.addMultiple(dataUri(environment));
|
|
9718
9781
|
functionRegistry.addMultiple(list);
|
|
9719
9782
|
functionRegistry.addMultiple(mathFunctions);
|
|
9720
|
-
functionRegistry.addMultiple(number
|
|
9783
|
+
functionRegistry.addMultiple(number);
|
|
9721
9784
|
functionRegistry.addMultiple(string);
|
|
9722
9785
|
functionRegistry.addMultiple(svg());
|
|
9723
9786
|
functionRegistry.addMultiple(types);
|
|
@@ -10185,7 +10248,7 @@
|
|
|
10185
10248
|
try {
|
|
10186
10249
|
var compress = Boolean(options.compress);
|
|
10187
10250
|
if (compress) {
|
|
10188
|
-
logger.warn('The compress option has been deprecated. ' +
|
|
10251
|
+
logger$1.warn('The compress option has been deprecated. ' +
|
|
10189
10252
|
'We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.');
|
|
10190
10253
|
}
|
|
10191
10254
|
var toCSSOptions = {
|
|
@@ -10266,7 +10329,7 @@
|
|
|
10266
10329
|
var importedEqualsRoot = fullPath === importManager.rootFilename;
|
|
10267
10330
|
if (importOptions.optional && e) {
|
|
10268
10331
|
callback(null, { rules: [] }, false, null);
|
|
10269
|
-
logger.info("The file " + fullPath + " was skipped because it was not found and the import was marked optional.");
|
|
10332
|
+
logger$1.info("The file " + fullPath + " was skipped because it was not found and the import was marked optional.");
|
|
10270
10333
|
}
|
|
10271
10334
|
else {
|
|
10272
10335
|
// Inline imports aren't cached here.
|
|
@@ -10512,7 +10575,7 @@
|
|
|
10512
10575
|
return render;
|
|
10513
10576
|
}
|
|
10514
10577
|
|
|
10515
|
-
var version = "4.1.
|
|
10578
|
+
var version = "4.1.2";
|
|
10516
10579
|
|
|
10517
10580
|
function parseNodeVersion(version) {
|
|
10518
10581
|
var match = version.match(/^v(\d{1,2})\.(\d{1,2})\.(\d{1,2})(?:-([0-9A-Za-z-.]+))?(?:\+([0-9A-Za-z-.]+))?$/); // eslint-disable-line max-len
|
|
@@ -10565,7 +10628,7 @@
|
|
|
10565
10628
|
transformTree: transformTree,
|
|
10566
10629
|
utils: utils,
|
|
10567
10630
|
PluginManager: PluginManagerFactory,
|
|
10568
|
-
logger: logger
|
|
10631
|
+
logger: logger$1
|
|
10569
10632
|
};
|
|
10570
10633
|
// Create a public API
|
|
10571
10634
|
var ctor = function (t) {
|
|
@@ -10603,8 +10666,8 @@
|
|
|
10603
10666
|
}
|
|
10604
10667
|
|
|
10605
10668
|
/* global window, XMLHttpRequest */
|
|
10606
|
-
var options;
|
|
10607
|
-
var logger
|
|
10669
|
+
var options$1;
|
|
10670
|
+
var logger;
|
|
10608
10671
|
var fileCache = {};
|
|
10609
10672
|
// TODOS - move log somewhere. pathDiff and doing something similar in node. use pathDiff in the other browser file for the initial load
|
|
10610
10673
|
var FileManager = function () { };
|
|
@@ -10620,11 +10683,11 @@
|
|
|
10620
10683
|
},
|
|
10621
10684
|
doXHR: function (url, type, callback, errback) {
|
|
10622
10685
|
var xhr = new XMLHttpRequest();
|
|
10623
|
-
var async = options.isFileProtocol ? options.fileAsync : true;
|
|
10686
|
+
var async = options$1.isFileProtocol ? options$1.fileAsync : true;
|
|
10624
10687
|
if (typeof xhr.overrideMimeType === 'function') {
|
|
10625
10688
|
xhr.overrideMimeType('text/css');
|
|
10626
10689
|
}
|
|
10627
|
-
logger
|
|
10690
|
+
logger.debug("XHR: Getting '" + url + "'");
|
|
10628
10691
|
xhr.open('GET', url, async);
|
|
10629
10692
|
xhr.setRequestHeader('Accept', type || 'text/x-less, text/css; q=0.9, */*; q=0.5');
|
|
10630
10693
|
xhr.send(null);
|
|
@@ -10636,7 +10699,7 @@
|
|
|
10636
10699
|
errback(xhr.status, url);
|
|
10637
10700
|
}
|
|
10638
10701
|
}
|
|
10639
|
-
if (options.isFileProtocol && !options.fileAsync) {
|
|
10702
|
+
if (options$1.isFileProtocol && !options$1.fileAsync) {
|
|
10640
10703
|
if (xhr.status === 0 || (xhr.status >= 200 && xhr.status < 300)) {
|
|
10641
10704
|
callback(xhr.responseText);
|
|
10642
10705
|
}
|
|
@@ -10696,8 +10759,8 @@
|
|
|
10696
10759
|
}
|
|
10697
10760
|
});
|
|
10698
10761
|
var FM = (function (opts, log) {
|
|
10699
|
-
options = opts;
|
|
10700
|
-
logger
|
|
10762
|
+
options$1 = opts;
|
|
10763
|
+
logger = log;
|
|
10701
10764
|
return FileManager;
|
|
10702
10765
|
});
|
|
10703
10766
|
|
|
@@ -11222,20 +11285,20 @@
|
|
|
11222
11285
|
* used in the browser distributed version of less
|
|
11223
11286
|
* to kick-start less using the browser api
|
|
11224
11287
|
*/
|
|
11225
|
-
var options
|
|
11288
|
+
var options = defaultOptions();
|
|
11226
11289
|
if (window.less) {
|
|
11227
11290
|
for (var key in window.less) {
|
|
11228
11291
|
if (window.less.hasOwnProperty(key)) {
|
|
11229
|
-
options
|
|
11292
|
+
options[key] = window.less[key];
|
|
11230
11293
|
}
|
|
11231
11294
|
}
|
|
11232
11295
|
}
|
|
11233
|
-
addDefaultOptions(window, options
|
|
11234
|
-
options
|
|
11296
|
+
addDefaultOptions(window, options);
|
|
11297
|
+
options.plugins = options.plugins || [];
|
|
11235
11298
|
if (window.LESS_PLUGINS) {
|
|
11236
|
-
options
|
|
11299
|
+
options.plugins = options.plugins.concat(window.LESS_PLUGINS);
|
|
11237
11300
|
}
|
|
11238
|
-
var less = root(window, options
|
|
11301
|
+
var less = root(window, options);
|
|
11239
11302
|
window.less = less;
|
|
11240
11303
|
var css;
|
|
11241
11304
|
var head;
|
|
@@ -11245,16 +11308,16 @@
|
|
|
11245
11308
|
if (data.filename) {
|
|
11246
11309
|
console.warn(data);
|
|
11247
11310
|
}
|
|
11248
|
-
if (!options
|
|
11311
|
+
if (!options.async) {
|
|
11249
11312
|
head.removeChild(style);
|
|
11250
11313
|
}
|
|
11251
11314
|
}
|
|
11252
|
-
if (options
|
|
11315
|
+
if (options.onReady) {
|
|
11253
11316
|
if (/!watch/.test(window.location.hash)) {
|
|
11254
11317
|
less.watch();
|
|
11255
11318
|
}
|
|
11256
11319
|
// Simulate synchronous stylesheet loading by hiding page rendering
|
|
11257
|
-
if (!options
|
|
11320
|
+
if (!options.async) {
|
|
11258
11321
|
css = 'body { display: none !important }';
|
|
11259
11322
|
head = document.head || document.getElementsByTagName('head')[0];
|
|
11260
11323
|
style = document.createElement('style');
|