less 2.6.1 → 2.7.3

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.
Files changed (135) hide show
  1. package/.travis.yml +3 -2
  2. package/CHANGELOG.md +26 -1
  3. package/Gruntfile.js +2 -3
  4. package/README.md +1 -1
  5. package/appveyor.yml +1 -0
  6. package/bin/lessc +47 -23
  7. package/dist/less.js +678 -374
  8. package/dist/less.min.js +9 -13
  9. package/lib/less/environment/abstract-file-manager.js +2 -2
  10. package/lib/less/functions/color.js +1 -1
  11. package/lib/less/index.js +1 -1
  12. package/lib/less/parser/parser-input.js +2 -2
  13. package/lib/less/parser/parser.js +45 -13
  14. package/lib/less/tree/anonymous.js +1 -1
  15. package/lib/less/tree/call.js +7 -4
  16. package/lib/less/tree/comment.js +2 -0
  17. package/lib/less/tree/directive.js +1 -0
  18. package/lib/less/tree/extend.js +1 -0
  19. package/lib/less/tree/import.js +1 -0
  20. package/lib/less/tree/media.js +1 -0
  21. package/lib/less/tree/mixin-call.js +1 -0
  22. package/lib/less/tree/mixin-definition.js +1 -0
  23. package/lib/less/tree/rule.js +1 -0
  24. package/lib/less/tree/ruleset-call.js +1 -0
  25. package/lib/less/tree/ruleset.js +1 -0
  26. package/lib/less/visitors/extend-visitor.js +5 -5
  27. package/lib/less/visitors/to-css-visitor.js +20 -10
  28. package/lib/less-browser/index.js +48 -25
  29. package/lib/less-node/file-manager.js +1 -1
  30. package/lib/less-node/lessc-helper.js +2 -2
  31. package/lib/source-map/source-map-0.1.31.js +1 -1
  32. package/package.json +25 -18
  33. package/test/browser/common.js +29 -8
  34. package/test/browser/less/console-errors/test-error.txt +1 -1
  35. package/test/browser/less.js +13 -17
  36. package/test/browser/runner-production-options.js +1 -1
  37. package/test/css/no-strict-math/no-sm-operations.css +3 -0
  38. package/test/css/operations.css +1 -1
  39. package/test/css/plugin.css +5 -0
  40. package/test/less/comments.less +1 -1
  41. package/test/less/errors/detached-ruleset-3.txt +1 -1
  42. package/test/less/errors/functions-1.less +2 -0
  43. package/test/less/errors/functions-1.txt +3 -0
  44. package/test/less/errors/functions-10-keyword.less +2 -0
  45. package/test/less/errors/functions-10-keyword.txt +3 -0
  46. package/test/less/errors/functions-11-operation.less +2 -0
  47. package/test/less/errors/functions-11-operation.txt +3 -0
  48. package/test/less/errors/functions-12-quoted.less +2 -0
  49. package/test/less/errors/functions-12-quoted.txt +3 -0
  50. package/test/less/errors/functions-13-selector.less +2 -0
  51. package/test/less/errors/functions-13-selector.txt +3 -0
  52. package/test/less/errors/functions-14-url.less +2 -0
  53. package/test/less/errors/functions-14-url.txt +3 -0
  54. package/test/less/errors/functions-15-value.less +2 -0
  55. package/test/less/errors/functions-15-value.txt +3 -0
  56. package/test/less/errors/functions-2-alpha.less +2 -0
  57. package/test/less/errors/functions-2-alpha.txt +3 -0
  58. package/test/less/errors/functions-3-assignment.less +2 -0
  59. package/test/less/errors/functions-3-assignment.txt +3 -0
  60. package/test/less/errors/functions-4-call.less +2 -0
  61. package/test/less/errors/functions-4-call.txt +3 -0
  62. package/test/less/errors/functions-5-color-2.less +1 -0
  63. package/test/less/errors/functions-5-color-2.txt +2 -0
  64. package/test/less/errors/functions-5-color.less +2 -0
  65. package/test/less/errors/functions-5-color.txt +3 -0
  66. package/test/less/errors/functions-6-condition.less +2 -0
  67. package/test/less/errors/functions-6-condition.txt +3 -0
  68. package/test/less/errors/functions-7-dimension.less +2 -0
  69. package/test/less/errors/functions-7-dimension.txt +3 -0
  70. package/test/less/errors/functions-8-element.less +2 -0
  71. package/test/less/errors/functions-8-element.txt +3 -0
  72. package/test/less/errors/functions-9-expression.less +2 -0
  73. package/test/less/errors/functions-9-expression.txt +3 -0
  74. package/test/less/errors/property-in-root.txt +1 -1
  75. package/test/less/errors/property-in-root2.txt +1 -1
  76. package/test/less/errors/property-in-root3.txt +1 -1
  77. package/test/less/errors/root-func-undefined-1.less +1 -0
  78. package/test/less/errors/root-func-undefined-1.txt +2 -0
  79. package/test/less/errors/root-func-undefined-2.less +2 -0
  80. package/test/less/errors/root-func-undefined-2.txt +3 -0
  81. package/test/less/extend-chaining.less +1 -1
  82. package/test/less/merge.less +4 -4
  83. package/test/less/mixins-guards.less +1 -1
  84. package/test/less/no-strict-math/no-sm-operations.less +4 -1
  85. package/test/less/operations.less +1 -1
  86. package/test/less/plugin/plugin-tree-nodes.js +80 -0
  87. package/test/less/plugin.less +8 -0
  88. package/test/less-bom/comments.less +1 -1
  89. package/test/less-bom/errors/detached-ruleset-3.txt +1 -1
  90. package/test/less-bom/errors/functions-1.less +2 -0
  91. package/test/less-bom/errors/functions-1.txt +3 -0
  92. package/test/less-bom/errors/functions-10-keyword.less +2 -0
  93. package/test/less-bom/errors/functions-10-keyword.txt +3 -0
  94. package/test/less-bom/errors/functions-11-operation.less +2 -0
  95. package/test/less-bom/errors/functions-11-operation.txt +3 -0
  96. package/test/less-bom/errors/functions-12-quoted.less +2 -0
  97. package/test/less-bom/errors/functions-12-quoted.txt +3 -0
  98. package/test/less-bom/errors/functions-13-selector.less +2 -0
  99. package/test/less-bom/errors/functions-13-selector.txt +3 -0
  100. package/test/less-bom/errors/functions-14-url.less +2 -0
  101. package/test/less-bom/errors/functions-14-url.txt +3 -0
  102. package/test/less-bom/errors/functions-15-value.less +2 -0
  103. package/test/less-bom/errors/functions-15-value.txt +3 -0
  104. package/test/less-bom/errors/functions-2-alpha.less +2 -0
  105. package/test/less-bom/errors/functions-2-alpha.txt +3 -0
  106. package/test/less-bom/errors/functions-3-assignment.less +2 -0
  107. package/test/less-bom/errors/functions-3-assignment.txt +3 -0
  108. package/test/less-bom/errors/functions-4-call.less +2 -0
  109. package/test/less-bom/errors/functions-4-call.txt +3 -0
  110. package/test/less-bom/errors/functions-5-color-2.less +1 -0
  111. package/test/less-bom/errors/functions-5-color-2.txt +2 -0
  112. package/test/less-bom/errors/functions-5-color.less +2 -0
  113. package/test/less-bom/errors/functions-5-color.txt +3 -0
  114. package/test/less-bom/errors/functions-6-condition.less +2 -0
  115. package/test/less-bom/errors/functions-6-condition.txt +3 -0
  116. package/test/less-bom/errors/functions-7-dimension.less +2 -0
  117. package/test/less-bom/errors/functions-7-dimension.txt +3 -0
  118. package/test/less-bom/errors/functions-8-element.less +2 -0
  119. package/test/less-bom/errors/functions-8-element.txt +3 -0
  120. package/test/less-bom/errors/functions-9-expression.less +2 -0
  121. package/test/less-bom/errors/functions-9-expression.txt +3 -0
  122. package/test/less-bom/errors/property-in-root.txt +1 -1
  123. package/test/less-bom/errors/property-in-root2.txt +1 -1
  124. package/test/less-bom/errors/property-in-root3.txt +1 -1
  125. package/test/less-bom/errors/root-func-undefined-1.less +1 -0
  126. package/test/less-bom/errors/root-func-undefined-1.txt +2 -0
  127. package/test/less-bom/errors/root-func-undefined-2.less +2 -0
  128. package/test/less-bom/errors/root-func-undefined-2.txt +3 -0
  129. package/test/less-bom/extend-chaining.less +1 -1
  130. package/test/less-bom/merge.less +4 -4
  131. package/test/less-bom/mixins-guards.less +1 -1
  132. package/test/less-bom/no-strict-math/no-sm-operations.less +4 -1
  133. package/test/less-bom/operations.less +1 -1
  134. package/test/less-bom/plugin/plugin-tree-nodes.js +80 -0
  135. package/test/less-bom/plugin.less +8 -0
@@ -0,0 +1,3 @@
1
+ SyntaxError: Function 'test-undefined' is undefined in {path}root-func-undefined-2.less on line 2, column 1:
2
+ 1 @plugin "../plugin/plugin-tree-nodes.js";
3
+ 2 test-undefined();
@@ -71,7 +71,7 @@
71
71
  &:extend(.vb);
72
72
  }
73
73
 
74
- // media queries - dont extend outside, do extend inside
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) {
@@ -26,22 +26,22 @@
26
26
  .second-transform();
27
27
  }
28
28
  .test2 {
29
- // Wont merge values without +: merge directive, for backwards compatibility with css
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
- // Wont merge values from two sources with different properties
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
- // Wont merge values from sources that merked as !important, for backwards compatibility with css
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
- // Wont merge values from mixins that merked as !important, for backwards compatibility with css
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, paranthesis and negation
281
+ // various combinations of nested or, and, parenthesis and negation
282
282
  .parenthesisNot(@value) when ((((@value)))) {
283
283
  parenthesisNot: just-value;
284
284
  }
@@ -6,5 +6,8 @@
6
6
  @3: -red;
7
7
  &-bar@{3} {x: y}
8
8
  @color: red;
9
- &-bar@{color} {a: a}
9
+ &-bar@{color} {a: a};
10
+ background-color: blue-2;
11
+ color: green-black;
12
+ animation: blue-change 5s infinite;
10
13
  }
@@ -7,7 +7,7 @@
7
7
  height: (10px / 2px+6px-1px*2);
8
8
  width: (2 * 4-5em);
9
9
  }
10
- substraction: (20 - 10 - 5 - 5); // 0
10
+ subtraction: (20 - 10 - 5 - 5); // 0
11
11
  division: (20 / 5 / 4); // 1
12
12
  }
13
13
 
@@ -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
+ });
@@ -81,5 +81,13 @@
81
81
  }
82
82
  }
83
83
 
84
+ @plugin "./plugin/plugin-tree-nodes";
85
+ @ruleset2: test-detached-ruleset();
86
+ .root {
87
+ @ruleset2();
88
+ }
89
+
90
+ test-directive("@charset"; '"utf-8"');
91
+ test-directive("@arbitrary"; "value after ()");
84
92
 
85
93