less 2.6.0 → 2.7.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/.travis.yml +3 -2
- package/CHANGELOG.md +30 -2
- package/Gruntfile.js +2 -3
- package/README.md +2 -2
- package/appveyor.yml +1 -0
- package/bin/lessc +47 -23
- package/dist/less.js +914 -582
- package/dist/less.min.js +9 -12
- package/lib/less/environment/abstract-file-manager.js +2 -2
- package/lib/less/functions/color.js +6 -3
- package/lib/less/index.js +1 -1
- package/lib/less/parser/parser-input.js +69 -69
- package/lib/less/parser/parser.js +111 -51
- package/lib/less/tree/anonymous.js +1 -1
- package/lib/less/tree/call.js +7 -4
- package/lib/less/tree/comment.js +2 -0
- package/lib/less/tree/directive.js +1 -0
- package/lib/less/tree/extend.js +1 -0
- package/lib/less/tree/import.js +1 -0
- package/lib/less/tree/media.js +1 -0
- package/lib/less/tree/mixin-call.js +1 -0
- package/lib/less/tree/mixin-definition.js +2 -1
- package/lib/less/tree/rule.js +1 -0
- package/lib/less/tree/ruleset-call.js +1 -0
- package/lib/less/tree/ruleset.js +86 -85
- package/lib/less/tree/unit.js +2 -2
- package/lib/less/visitors/extend-visitor.js +5 -5
- package/lib/less/visitors/to-css-visitor.js +20 -10
- package/lib/less-browser/error-reporting.js +10 -10
- package/lib/less-browser/index.js +48 -25
- package/lib/less-node/file-manager.js +1 -1
- package/lib/less-node/lessc-helper.js +2 -2
- package/lib/source-map/source-map-0.1.31.js +1 -1
- package/package.json +29 -22
- package/test/browser/common.js +29 -8
- package/test/browser/less/console-errors/test-error.txt +1 -1
- package/test/browser/less.js +13 -16
- package/test/browser/runner-production-options.js +1 -1
- package/test/css/comments2.css +6 -0
- package/test/css/no-strict-math/mixins-guards.css +12 -0
- package/test/css/no-strict-math/no-sm-operations.css +3 -0
- package/test/css/operations.css +1 -1
- package/test/css/plugin.css +5 -0
- package/test/less/comments.less +1 -1
- package/test/less/comments2.less +11 -0
- package/test/less/errors/detached-ruleset-3.txt +1 -1
- package/test/less/errors/functions-1.less +2 -0
- package/test/less/errors/functions-1.txt +3 -0
- package/test/less/errors/functions-10-keyword.less +2 -0
- package/test/less/errors/functions-10-keyword.txt +3 -0
- package/test/less/errors/functions-11-operation.less +2 -0
- package/test/less/errors/functions-11-operation.txt +3 -0
- package/test/less/errors/functions-12-quoted.less +2 -0
- package/test/less/errors/functions-12-quoted.txt +3 -0
- package/test/less/errors/functions-13-selector.less +2 -0
- package/test/less/errors/functions-13-selector.txt +3 -0
- package/test/less/errors/functions-14-url.less +2 -0
- package/test/less/errors/functions-14-url.txt +3 -0
- package/test/less/errors/functions-15-value.less +2 -0
- package/test/less/errors/functions-15-value.txt +3 -0
- package/test/less/errors/functions-2-alpha.less +2 -0
- package/test/less/errors/functions-2-alpha.txt +3 -0
- package/test/less/errors/functions-3-assignment.less +2 -0
- package/test/less/errors/functions-3-assignment.txt +3 -0
- package/test/less/errors/functions-4-call.less +2 -0
- package/test/less/errors/functions-4-call.txt +3 -0
- package/test/less/errors/functions-5-color-2.less +1 -0
- package/test/less/errors/functions-5-color-2.txt +2 -0
- package/test/less/errors/functions-5-color.less +2 -0
- package/test/less/errors/functions-5-color.txt +3 -0
- package/test/less/errors/functions-6-condition.less +2 -0
- package/test/less/errors/functions-6-condition.txt +3 -0
- package/test/less/errors/functions-7-dimension.less +2 -0
- package/test/less/errors/functions-7-dimension.txt +3 -0
- package/test/less/errors/functions-8-element.less +2 -0
- package/test/less/errors/functions-8-element.txt +3 -0
- package/test/less/errors/functions-9-expression.less +2 -0
- package/test/less/errors/functions-9-expression.txt +3 -0
- package/test/less/errors/property-in-root.txt +1 -1
- package/test/less/errors/property-in-root2.txt +1 -1
- package/test/less/errors/property-in-root3.txt +1 -1
- package/test/less/errors/root-func-undefined-1.less +1 -0
- package/test/less/errors/root-func-undefined-1.txt +2 -0
- package/test/less/errors/root-func-undefined-2.less +2 -0
- package/test/less/errors/root-func-undefined-2.txt +3 -0
- package/test/less/extend-chaining.less +1 -1
- package/test/less/merge.less +4 -4
- package/test/less/mixins-guards.less +1 -1
- package/test/less/no-strict-math/mixins-guards.less +25 -0
- package/test/less/no-strict-math/no-sm-operations.less +4 -1
- package/test/less/operations.less +1 -1
- package/test/less/plugin/plugin-tree-nodes.js +80 -0
- package/test/less/plugin.less +8 -0
- package/test/less-bom/comments.less +1 -1
- package/test/less-bom/comments2.less +11 -0
- package/test/less-bom/errors/detached-ruleset-3.txt +1 -1
- package/test/less-bom/errors/functions-1.less +2 -0
- package/test/less-bom/errors/functions-1.txt +3 -0
- package/test/less-bom/errors/functions-10-keyword.less +2 -0
- package/test/less-bom/errors/functions-10-keyword.txt +3 -0
- package/test/less-bom/errors/functions-11-operation.less +2 -0
- package/test/less-bom/errors/functions-11-operation.txt +3 -0
- package/test/less-bom/errors/functions-12-quoted.less +2 -0
- package/test/less-bom/errors/functions-12-quoted.txt +3 -0
- package/test/less-bom/errors/functions-13-selector.less +2 -0
- package/test/less-bom/errors/functions-13-selector.txt +3 -0
- package/test/less-bom/errors/functions-14-url.less +2 -0
- package/test/less-bom/errors/functions-14-url.txt +3 -0
- package/test/less-bom/errors/functions-15-value.less +2 -0
- package/test/less-bom/errors/functions-15-value.txt +3 -0
- package/test/less-bom/errors/functions-2-alpha.less +2 -0
- package/test/less-bom/errors/functions-2-alpha.txt +3 -0
- package/test/less-bom/errors/functions-3-assignment.less +2 -0
- package/test/less-bom/errors/functions-3-assignment.txt +3 -0
- package/test/less-bom/errors/functions-4-call.less +2 -0
- package/test/less-bom/errors/functions-4-call.txt +3 -0
- package/test/less-bom/errors/functions-5-color-2.less +1 -0
- package/test/less-bom/errors/functions-5-color-2.txt +2 -0
- package/test/less-bom/errors/functions-5-color.less +2 -0
- package/test/less-bom/errors/functions-5-color.txt +3 -0
- package/test/less-bom/errors/functions-6-condition.less +2 -0
- package/test/less-bom/errors/functions-6-condition.txt +3 -0
- package/test/less-bom/errors/functions-7-dimension.less +2 -0
- package/test/less-bom/errors/functions-7-dimension.txt +3 -0
- package/test/less-bom/errors/functions-8-element.less +2 -0
- package/test/less-bom/errors/functions-8-element.txt +3 -0
- package/test/less-bom/errors/functions-9-expression.less +2 -0
- package/test/less-bom/errors/functions-9-expression.txt +3 -0
- package/test/less-bom/errors/property-in-root.txt +1 -1
- package/test/less-bom/errors/property-in-root2.txt +1 -1
- package/test/less-bom/errors/property-in-root3.txt +1 -1
- package/test/less-bom/errors/root-func-undefined-1.less +1 -0
- package/test/less-bom/errors/root-func-undefined-1.txt +2 -0
- package/test/less-bom/errors/root-func-undefined-2.less +2 -0
- package/test/less-bom/errors/root-func-undefined-2.txt +3 -0
- package/test/less-bom/extend-chaining.less +1 -1
- package/test/less-bom/merge.less +4 -4
- package/test/less-bom/mixins-guards.less +1 -1
- package/test/less-bom/no-strict-math/mixins-guards.less +25 -0
- package/test/less-bom/no-strict-math/no-sm-operations.less +4 -1
- package/test/less-bom/operations.less +1 -1
- package/test/less-bom/plugin/plugin-tree-nodes.js +80 -0
- package/test/less-bom/plugin.less +8 -0
- package/test/sourcemaps/maps/import-map.map +1 -0
package/test/css/comments2.css
CHANGED
package/test/css/operations.css
CHANGED
package/test/css/plugin.css
CHANGED
package/test/less/comments.less
CHANGED
package/test/less/comments2.less
CHANGED
|
@@ -18,3 +18,14 @@
|
|
|
18
18
|
@gutter-width * // We strongly recommend you */
|
|
19
19
|
@columns); // do not change this formula. */
|
|
20
20
|
@total-width : @gridsystem-width; // set to 100% for fluid grid */
|
|
21
|
+
|
|
22
|
+
// .............................................................................
|
|
23
|
+
|
|
24
|
+
.some-inline-comments {
|
|
25
|
+
a: yes /* comment */;
|
|
26
|
+
b: red /* comment */;
|
|
27
|
+
@c: yes /* comment */;
|
|
28
|
+
@d: red /* comment */;
|
|
29
|
+
c: @c;
|
|
30
|
+
d: @d;
|
|
31
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
SyntaxError:
|
|
1
|
+
SyntaxError: Properties must be inside selector blocks. They cannot be in the root in {path}detached-ruleset-3.less on line 2, column 3:
|
|
2
2
|
1 @a: {
|
|
3
3
|
2 b: 1;
|
|
4
4
|
3 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
rgba(0,0,0,0);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
SyntaxError:
|
|
1
|
+
SyntaxError: Properties must be inside selector blocks. They cannot be in the root in {path}property-in-root.less on line 2, column 3:
|
|
2
2
|
1 .a() {
|
|
3
3
|
2 prop:1;
|
|
4
4
|
3 }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
SyntaxError:
|
|
1
|
+
SyntaxError: Properties must be inside selector blocks. They cannot be in the root in {path}property-in-root.less on line 2, column 3:
|
|
2
2
|
1 .a() {
|
|
3
3
|
2 prop:1;
|
|
4
4
|
3 }
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
SyntaxError:
|
|
1
|
+
SyntaxError: Properties must be inside selector blocks. They cannot be in the root in {path}property-in-root3.less on line 1, column 1:
|
|
2
2
|
1 prop:1;
|
|
3
3
|
2 .a {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
func();
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
&:extend(.vb);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
// media queries -
|
|
74
|
+
// media queries - don't extend outside, do extend inside
|
|
75
75
|
|
|
76
76
|
@media tv {
|
|
77
77
|
.ma:extend(.a,.b,.c,.d,.e,.f,.g,.h,.i,.j,.k,.l,.m,.n,.o,.p,.q,.r,.s,.t,.u,.v,.w,.x,.y,.z,.md) {
|
package/test/less/merge.less
CHANGED
|
@@ -26,22 +26,22 @@
|
|
|
26
26
|
.second-transform();
|
|
27
27
|
}
|
|
28
28
|
.test2 {
|
|
29
|
-
//
|
|
29
|
+
// Won't merge values without +: merge directive, for backwards compatibility with css
|
|
30
30
|
.first-transform();
|
|
31
31
|
.third-transform();
|
|
32
32
|
}
|
|
33
33
|
.test3 {
|
|
34
|
-
//
|
|
34
|
+
// Won't merge values from two sources with different properties
|
|
35
35
|
.fourth-transform();
|
|
36
36
|
.first-background();
|
|
37
37
|
}
|
|
38
38
|
.test4 {
|
|
39
|
-
//
|
|
39
|
+
// Won't merge values from sources that merked as !important, for backwards compatibility with css
|
|
40
40
|
.first-transform();
|
|
41
41
|
.fifth-transform();
|
|
42
42
|
}
|
|
43
43
|
.test5 {
|
|
44
|
-
//
|
|
44
|
+
// Won't merge values from mixins that merked as !important, for backwards compatibility with css
|
|
45
45
|
.first-transform();
|
|
46
46
|
.second-transform() !important;
|
|
47
47
|
}
|
|
@@ -278,7 +278,7 @@
|
|
|
278
278
|
.guarded-mixin-for-root() when (@guarded-mixin-for-root) {}
|
|
279
279
|
}
|
|
280
280
|
#ns > .guarded-mixin-for-root();
|
|
281
|
-
// various combinations of nested or, and,
|
|
281
|
+
// various combinations of nested or, and, parenthesis and negation
|
|
282
282
|
.parenthesisNot(@value) when ((((@value)))) {
|
|
283
283
|
parenthesisNot: just-value;
|
|
284
284
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// https://github.com/less/less.js/issues/2798
|
|
2
|
+
.test-2798 when ((8+4) < 13) {
|
|
3
|
+
regression: fixed;
|
|
4
|
+
}
|
|
5
|
+
.test-2798 when ((8+6) < 13) {
|
|
6
|
+
regression: should not be visible;
|
|
7
|
+
}
|
|
8
|
+
.conditions-parser-1 when (8+4 < 13) {
|
|
9
|
+
only-atomic: ok;
|
|
10
|
+
}
|
|
11
|
+
.conditions-parser-1 when (8+6 < 13) {
|
|
12
|
+
only-atomic: should not be visible;
|
|
13
|
+
}
|
|
14
|
+
.conditions-parser-2 when (8+(5-1) < 13) {
|
|
15
|
+
only-atomic-with-nested-parenthesis: ok;
|
|
16
|
+
}
|
|
17
|
+
.conditions-parser-2 when (8+(15-1) < 13) {
|
|
18
|
+
only-atomic-with-nested-parenthesis: should not be visible;
|
|
19
|
+
}
|
|
20
|
+
.conditions-parser-3 when (8 < (13+1)) {
|
|
21
|
+
only-atomic-nested-parenthesis-on-right: ok;
|
|
22
|
+
}
|
|
23
|
+
.conditions-parser-3 when (8 < (3+1)) {
|
|
24
|
+
only-atomic-nested-parenthesis-on-right: should not be visible;
|
|
25
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
functions.addMultiple({
|
|
2
|
+
|
|
3
|
+
"test-comment": function() {
|
|
4
|
+
return new tree.Combinator(' ');
|
|
5
|
+
},
|
|
6
|
+
"test-directive": function(arg1, arg2) {
|
|
7
|
+
return new tree.Directive(arg1.value, new tree.Anonymous(arg2.value));
|
|
8
|
+
},
|
|
9
|
+
"test-extend": function() {
|
|
10
|
+
//TODO
|
|
11
|
+
},
|
|
12
|
+
"test-import": function() {
|
|
13
|
+
//TODO
|
|
14
|
+
},
|
|
15
|
+
"test-media": function() {
|
|
16
|
+
//TODO
|
|
17
|
+
},
|
|
18
|
+
"test-mixin-call": function() {
|
|
19
|
+
//TODO
|
|
20
|
+
},
|
|
21
|
+
"test-mixin-definition": function() {
|
|
22
|
+
//TODO
|
|
23
|
+
},
|
|
24
|
+
"test-ruleset-call": function() {
|
|
25
|
+
return new tree.Combinator(' ');
|
|
26
|
+
},
|
|
27
|
+
// Functions must return something. Must 'return true' if they produce no output.
|
|
28
|
+
"test-undefined": function() { },
|
|
29
|
+
|
|
30
|
+
// These cause root errors
|
|
31
|
+
"test-alpha": function() {
|
|
32
|
+
return new tree.Alpha(30);
|
|
33
|
+
},
|
|
34
|
+
"test-assignment": function() {
|
|
35
|
+
return new tree.Assignment("bird", "robin");
|
|
36
|
+
},
|
|
37
|
+
"test-attribute": function() {
|
|
38
|
+
return new tree.Attribute("foo", "=", "bar");
|
|
39
|
+
},
|
|
40
|
+
"test-call": function() {
|
|
41
|
+
return new tree.Call("foo");
|
|
42
|
+
},
|
|
43
|
+
"test-color": function() {
|
|
44
|
+
return new tree.Color([50, 50, 50]);
|
|
45
|
+
},
|
|
46
|
+
"test-condition": function() {
|
|
47
|
+
return new tree.Condition('<', new tree.Value([0]), new tree.Value([1]));
|
|
48
|
+
},
|
|
49
|
+
"test-detached-ruleset" : function() {
|
|
50
|
+
var rule = new tree.Rule('prop', new tree.Anonymous('value'));
|
|
51
|
+
return new tree.DetachedRuleset(new tree.Ruleset("", [ rule ]));
|
|
52
|
+
},
|
|
53
|
+
"test-dimension": function() {
|
|
54
|
+
return new tree.Dimension(1, 'px');
|
|
55
|
+
},
|
|
56
|
+
"test-element": function() {
|
|
57
|
+
return new tree.Element('+', 'a');
|
|
58
|
+
},
|
|
59
|
+
"test-expression": function() {
|
|
60
|
+
return new tree.Expression([1, 2, 3]);
|
|
61
|
+
},
|
|
62
|
+
"test-keyword": function() {
|
|
63
|
+
return new tree.Keyword('foo');
|
|
64
|
+
},
|
|
65
|
+
"test-operation": function() {
|
|
66
|
+
return new tree.Operation('+', [1, 2]);
|
|
67
|
+
},
|
|
68
|
+
"test-quoted": function() {
|
|
69
|
+
return new tree.Quoted('"', 'foo');
|
|
70
|
+
},
|
|
71
|
+
"test-selector": function() {
|
|
72
|
+
return new tree.Selector([new tree.Element('a')]);
|
|
73
|
+
},
|
|
74
|
+
"test-url": function() {
|
|
75
|
+
return new tree.URL('http://google.com');
|
|
76
|
+
},
|
|
77
|
+
"test-value": function() {
|
|
78
|
+
return new tree.Value([1]);
|
|
79
|
+
}
|
|
80
|
+
});
|
package/test/less/plugin.less
CHANGED
|
@@ -18,3 +18,14 @@
|
|
|
18
18
|
@gutter-width * // We strongly recommend you */
|
|
19
19
|
@columns); // do not change this formula. */
|
|
20
20
|
@total-width : @gridsystem-width; // set to 100% for fluid grid */
|
|
21
|
+
|
|
22
|
+
// .............................................................................
|
|
23
|
+
|
|
24
|
+
.some-inline-comments {
|
|
25
|
+
a: yes /* comment */;
|
|
26
|
+
b: red /* comment */;
|
|
27
|
+
@c: yes /* comment */;
|
|
28
|
+
@d: red /* comment */;
|
|
29
|
+
c: @c;
|
|
30
|
+
d: @d;
|
|
31
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
SyntaxError:
|
|
1
|
+
SyntaxError: Properties must be inside selector blocks. They cannot be in the root in {path}detached-ruleset-3.less on line 2, column 3:
|
|
2
2
|
1 @a: {
|
|
3
3
|
2 b: 1;
|
|
4
4
|
3 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
rgba(0,0,0,0);
|