less 3.0.0-pre.2 → 3.0.1

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 (205) hide show
  1. package/.eslintrc.json +88 -0
  2. package/.github/stale.yml +17 -0
  3. package/.project +17 -0
  4. package/.settings/org.eclipse.buildship.core.prefs +2 -0
  5. package/.travis.yml +22 -3
  6. package/.vscode/launch.json +14 -0
  7. package/CHANGELOG.md +27 -0
  8. package/Gruntfile.js +191 -86
  9. package/README.md +5 -7
  10. package/appveyor.yml +9 -10
  11. package/bin/lessc +37 -50
  12. package/dist/less.js +1357 -1269
  13. package/dist/less.min.js +7 -7
  14. package/lib/less/contexts.js +20 -16
  15. package/lib/less/default-options.js +65 -0
  16. package/lib/less/environment/abstract-file-manager.js +13 -14
  17. package/lib/less/environment/abstract-plugin-loader.js +45 -36
  18. package/lib/less/environment/environment.js +5 -0
  19. package/lib/less/functions/boolean.js +15 -0
  20. package/lib/less/functions/color.js +54 -24
  21. package/lib/less/functions/data-uri.js +5 -2
  22. package/lib/less/functions/function-registry.js +1 -1
  23. package/lib/less/functions/index.js +2 -1
  24. package/lib/less/functions/number.js +2 -2
  25. package/lib/less/functions/string.js +2 -2
  26. package/lib/less/functions/svg.js +4 -4
  27. package/lib/less/import-manager.js +41 -29
  28. package/lib/less/index.js +28 -3
  29. package/lib/less/less-error.js +112 -13
  30. package/lib/less/parse.js +18 -15
  31. package/lib/less/parser/parser-input.js +4 -4
  32. package/lib/less/parser/parser.js +208 -114
  33. package/lib/less/plugin-manager.js +8 -33
  34. package/lib/less/render.js +6 -2
  35. package/lib/less/source-map-builder.js +3 -0
  36. package/lib/less/source-map-output.js +13 -8
  37. package/lib/less/transform-tree.js +2 -2
  38. package/lib/less/tree/anonymous.js +4 -1
  39. package/lib/less/tree/atrule.js +7 -6
  40. package/lib/less/tree/call.js +25 -3
  41. package/lib/less/tree/color.js +2 -2
  42. package/lib/less/tree/debug-info.js +1 -1
  43. package/lib/less/tree/declaration.js +6 -5
  44. package/lib/less/tree/dimension.js +4 -1
  45. package/lib/less/tree/extend.js +2 -2
  46. package/lib/less/tree/import.js +17 -9
  47. package/lib/less/tree/index.js +3 -7
  48. package/lib/less/tree/js-eval-node.js +1 -1
  49. package/lib/less/tree/media.js +3 -14
  50. package/lib/less/tree/mixin-definition.js +3 -3
  51. package/lib/less/tree/node.js +9 -6
  52. package/lib/less/tree/operation.js +1 -1
  53. package/lib/less/tree/property.js +70 -0
  54. package/lib/less/tree/quoted.js +11 -10
  55. package/lib/less/tree/ruleset.js +115 -71
  56. package/lib/less/tree/selector.js +38 -23
  57. package/lib/less/tree/unit.js +1 -1
  58. package/lib/less/tree/value.js +6 -1
  59. package/lib/less/tree/{ruleset-call.js → variable-call.js} +5 -5
  60. package/lib/less/tree/variable.js +6 -6
  61. package/lib/less/utils.js +40 -0
  62. package/lib/less/visitors/extend-visitor.js +14 -14
  63. package/lib/less/visitors/import-visitor.js +2 -2
  64. package/lib/less/visitors/join-selector-visitor.js +1 -1
  65. package/lib/less/visitors/to-css-visitor.js +51 -84
  66. package/lib/less/visitors/visitor.js +15 -15
  67. package/lib/less-browser/bootstrap.js +21 -5
  68. package/lib/less-browser/cache.js +2 -2
  69. package/lib/less-browser/error-reporting.js +5 -5
  70. package/lib/less-browser/file-manager.js +27 -35
  71. package/lib/less-browser/index.js +12 -17
  72. package/lib/less-browser/plugin-loader.js +8 -45
  73. package/lib/less-browser/utils.js +1 -1
  74. package/lib/less-node/file-manager.js +99 -69
  75. package/lib/less-node/fs.js +1 -1
  76. package/lib/less-node/image-size.js +2 -2
  77. package/lib/less-node/index.js +7 -57
  78. package/lib/less-node/lessc-helper.js +38 -38
  79. package/lib/less-node/plugin-loader.js +18 -79
  80. package/lib/less-node/url-file-manager.js +1 -1
  81. package/lib/less-rhino/index.js +29 -44
  82. package/package.json +16 -9
  83. package/test/browser/common.js +54 -18
  84. package/test/browser/css/plugin/plugin.css +3 -0
  85. package/test/browser/jasmine-jsreporter.js +4 -4
  86. package/test/browser/less/plugin/plugin.js +7 -0
  87. package/test/browser/less/plugin/plugin.less +4 -0
  88. package/test/browser/less.js +11685 -13
  89. package/test/browser/runner-browser-options.js +6 -1
  90. package/test/browser/runner-filemanagerPlugin-options.js +3 -2
  91. package/test/browser/runner-legacy-options.js +2 -1
  92. package/test/browser/runner-main-options.js +0 -1
  93. package/test/browser/runner-modify-vars-spec.js +2 -2
  94. package/test/browser/test-runner-template.tmpl +38 -14
  95. package/test/copy-bom.js +1 -1
  96. package/test/css/calc.css +5 -0
  97. package/test/css/comments2.css +1 -1
  98. package/test/css/compression/compression.css +1 -1
  99. package/test/css/css-grid.css +11 -0
  100. package/test/css/debug/linenumbers-all.css +0 -1
  101. package/test/css/debug/linenumbers-comments.css +0 -1
  102. package/test/css/debug/linenumbers-mediaquery.css +0 -1
  103. package/test/css/functions.css +16 -3
  104. package/test/css/import-module.css +9 -0
  105. package/test/css/import.css +0 -1
  106. package/test/css/legacy/legacy.css +1 -1
  107. package/test/css/merge.css +5 -4
  108. package/test/css/plugin-module.css +1 -0
  109. package/test/css/plugin.css +20 -0
  110. package/test/css/property-accessors.css +49 -0
  111. package/test/css/{css.css → strict-math/css.css} +0 -0
  112. package/test/css/{mixins-args.css → strict-math/mixins-args.css} +0 -0
  113. package/test/css/{parens.css → strict-math/parens.css} +0 -0
  114. package/test/import-module/one/1.less +3 -0
  115. package/test/import-module/one/two/2.less +3 -0
  116. package/test/import-module/one/two/three/3.less +3 -0
  117. package/test/import-module/package.json +11 -0
  118. package/test/index.js +55 -49
  119. package/test/less/calc.less +7 -0
  120. package/test/less/css-grid.less +15 -0
  121. package/test/less/detached-rulesets.less +2 -2
  122. package/test/less/errors/color-invalid-hex-code.less +1 -0
  123. package/test/less/errors/color-invalid-hex-code.txt +1 -1
  124. package/test/less/errors/color-invalid-hex-code2.less +1 -0
  125. package/test/less/errors/color-invalid-hex-code2.txt +1 -1
  126. package/test/less/errors/import-missing.txt +1 -1
  127. package/test/less/errors/plugin/plugin-error-2.js +5 -0
  128. package/test/less/errors/plugin/plugin-error-3.js +5 -0
  129. package/test/less/errors/plugin/plugin-error.js +1 -0
  130. package/test/less/errors/plugin-1.less +1 -0
  131. package/test/less/errors/plugin-1.txt +2 -0
  132. package/test/less/errors/plugin-2.less +1 -0
  133. package/test/less/errors/plugin-2.txt +5 -0
  134. package/test/less/errors/plugin-3.less +1 -0
  135. package/test/less/errors/plugin-3.txt +5 -0
  136. package/test/less/functions.less +18 -0
  137. package/test/less/import-module.less +3 -0
  138. package/test/less/import.less +0 -2
  139. package/test/less/legacy/legacy.less +1 -1
  140. package/test/less/media.less +2 -2
  141. package/test/less/merge.less +6 -3
  142. package/test/less/plugin/plugin-collection.js +9 -0
  143. package/test/less/plugin/plugin-local.js +2 -2
  144. package/test/less/plugin/plugin-scope1.js +3 -0
  145. package/test/less/plugin/plugin-scope2.js +3 -0
  146. package/test/less/plugin/plugin-simple.js +7 -0
  147. package/test/less/plugin/plugin-tree-nodes.js +33 -31
  148. package/test/less/plugin-module.less +7 -0
  149. package/test/less/plugin.less +33 -3
  150. package/test/less/property-accessors.less +67 -0
  151. package/test/less/root-registry/file.less +1 -0
  152. package/test/less/root-registry/root.less +3 -0
  153. package/test/less/{css.less → strict-math/css.less} +0 -0
  154. package/test/less/{mixins-args.less → strict-math/mixins-args.less} +0 -0
  155. package/test/less/{parens.less → strict-math/parens.less} +0 -0
  156. package/test/less-bom/calc.less +7 -0
  157. package/test/less-bom/css-grid.less +15 -0
  158. package/test/less-bom/detached-rulesets.less +2 -2
  159. package/test/less-bom/errors/color-invalid-hex-code.less +1 -0
  160. package/test/less-bom/errors/color-invalid-hex-code.txt +1 -1
  161. package/test/less-bom/errors/color-invalid-hex-code2.less +1 -0
  162. package/test/less-bom/errors/color-invalid-hex-code2.txt +1 -1
  163. package/test/less-bom/errors/import-missing.txt +1 -1
  164. package/test/less-bom/errors/plugin/plugin-error-2.js +5 -0
  165. package/test/less-bom/errors/plugin/plugin-error-3.js +5 -0
  166. package/test/less-bom/errors/plugin/plugin-error.js +1 -0
  167. package/test/less-bom/errors/plugin-1.less +1 -0
  168. package/test/less-bom/errors/plugin-1.txt +2 -0
  169. package/test/less-bom/errors/plugin-2.less +1 -0
  170. package/test/less-bom/errors/plugin-2.txt +5 -0
  171. package/test/less-bom/errors/plugin-3.less +1 -0
  172. package/test/less-bom/errors/plugin-3.txt +5 -0
  173. package/test/less-bom/functions.less +18 -0
  174. package/test/less-bom/import-module.less +3 -0
  175. package/test/less-bom/import.less +0 -2
  176. package/test/less-bom/legacy/legacy.less +1 -1
  177. package/test/less-bom/media.less +2 -2
  178. package/test/less-bom/merge.less +6 -3
  179. package/test/less-bom/plugin/plugin-collection.js +9 -0
  180. package/test/less-bom/plugin/plugin-local.js +2 -2
  181. package/test/less-bom/plugin/plugin-scope1.js +3 -0
  182. package/test/less-bom/plugin/plugin-scope2.js +3 -0
  183. package/test/less-bom/plugin/plugin-simple.js +7 -0
  184. package/test/less-bom/plugin/plugin-tree-nodes.js +33 -31
  185. package/test/less-bom/plugin-module.less +7 -0
  186. package/test/less-bom/plugin.less +33 -3
  187. package/test/less-bom/property-accessors.less +67 -0
  188. package/test/less-bom/root-registry/file.less +1 -0
  189. package/test/less-bom/root-registry/root.less +3 -0
  190. package/test/less-bom/{css.less → strict-math/css.less} +0 -0
  191. package/test/less-bom/{mixins-args.less → strict-math/mixins-args.less} +0 -0
  192. package/test/less-bom/{parens.less → strict-math/parens.less} +0 -0
  193. package/test/less-test.js +75 -17
  194. package/test/modify-vars.js +1 -1
  195. package/test/plugins/visitor/index.js +1 -1
  196. package/.jscsrc +0 -73
  197. package/.jshintrc +0 -11
  198. package/lib/less/tree/alpha.js +0 -28
  199. package/lib/less/tree/directive.js +0 -12
  200. package/lib/less/tree/rule.js +0 -12
  201. package/test/less/errors/functions-2-alpha.less +0 -2
  202. package/test/less/errors/functions-2-alpha.txt +0 -3
  203. package/test/less-bom/errors/functions-2-alpha.less +0 -2
  204. package/test/less-bom/errors/functions-2-alpha.txt +0 -3
  205. package/test/sourcemaps/maps/import-map.map +0 -1
@@ -230,3 +230,21 @@ html {
230
230
  color: mix(blue, @color1, 50%);
231
231
  color: mix(blue, @color2, 50%);
232
232
  }
233
+
234
+ #boolean {
235
+ a: boolean(not(2 < 1));
236
+ b: boolean(not(2 > 1) and (true));
237
+ c: boolean(not(boolean((true))));
238
+ }
239
+
240
+ #if {
241
+ a: if(not(false), 1, 2);
242
+ b: if(not(true), 1, 2);
243
+ @1: if(not(false), {c: 3}, {d: 4}); @1();
244
+
245
+ e: if(not(true), 5);
246
+ @f: boolean((3 = 4));
247
+ f: if(not(@f), 6);
248
+
249
+ if((false), {g: 7}); /* results in void */
250
+ }
@@ -0,0 +1,3 @@
1
+ @import "import-module/one/two/three/3.less";
2
+ @import "import-module/one/two/2";
3
+ @import "import-module/one/1.less";
@@ -1,6 +1,4 @@
1
1
  /** comment at the top**/
2
- @import url(http://fonts.googleapis.com/css?family=Open+Sans);
3
-
4
2
  @import url(/absolute/something.css) screen and (color) and (max-width: 600px);
5
3
 
6
4
  @import (optional) "file-does-not-exist.does-not-exist";
@@ -1,4 +1,4 @@
1
- @media (-o-min-device-pixel-ratio: 2/1) {
1
+ @media (-o-min-device-pixel-ratio: 2) {
2
2
  .test-math-and-units {
3
3
  font: ignores 0/0 rules;
4
4
  test-division: 4 / 2 + 5em;
@@ -23,7 +23,7 @@
23
23
  @ratio_large: 16;
24
24
  @ratio_small: 9;
25
25
 
26
- @media all and (device-aspect-ratio: @ratio_large / @ratio_small) {
26
+ @media all and (device-aspect-ratio: ~"@{ratio_large} / @{ratio_small}") {
27
27
  body { max-width: 800px; }
28
28
  }
29
29
 
@@ -177,7 +177,7 @@ body {
177
177
  }
178
178
  }
179
179
 
180
- @media (-webkit-min-device-pixel-ratio: 2), (min--moz-device-pixel-ratio: 2), (-o-min-device-pixel-ratio: 2/1), (min-resolution: 2dppx), (min-resolution: 128dpcm) {
180
+ @media (-webkit-min-device-pixel-ratio: 2), (min--moz-device-pixel-ratio: 2), (-o-min-device-pixel-ratio: ~"2/1"), (min-resolution: 2dppx), (min-resolution: 128dpcm) {
181
181
  .b {
182
182
  background: red;
183
183
  }
@@ -36,17 +36,20 @@
36
36
  .first-background();
37
37
  }
38
38
  .test4 {
39
- // Won't merge values from sources that merked as !important, for backwards compatibility with css
40
39
  .first-transform();
41
40
  .fifth-transform();
42
41
  }
43
42
  .test5 {
44
- // Won't merge values from mixins that merked as !important, for backwards compatibility with css
45
43
  .first-transform();
46
44
  .second-transform() !important;
47
45
  }
48
46
  .test6 {
49
- // Ignores !merge if no peers found
47
+ .second-transform();
48
+ }
49
+ .test7 {
50
+ // inherit !important from merged subrules
51
+ .second-transform();
52
+ .second-transform() !important;
50
53
  .second-transform();
51
54
  }
52
55
 
@@ -0,0 +1,9 @@
1
+ var collection = [];
2
+
3
+ functions.add('store', function(val) {
4
+ collection.push(val); // imma store this for later
5
+ return false;
6
+ });
7
+ functions.add('list', function() {
8
+ return less.value(collection);
9
+ });
@@ -7,8 +7,8 @@ functions.addMultiple({
7
7
  }
8
8
  });
9
9
 
10
- return {
10
+ registerPlugin({
11
11
  setOptions: function(raw) {
12
12
  // do nothing
13
13
  }
14
- }
14
+ });
@@ -0,0 +1,3 @@
1
+ functions.add('foo', function() {
2
+ return "foo";
3
+ });
@@ -0,0 +1,3 @@
1
+ functions.add('foo', function() {
2
+ return "bar";
3
+ });
@@ -0,0 +1,7 @@
1
+ functions.add('pi-anon', function() {
2
+ return Math.PI;
3
+ });
4
+
5
+ functions.add('pi', function() {
6
+ return less.dimension(Math.PI);
7
+ });
@@ -1,80 +1,82 @@
1
1
  functions.addMultiple({
2
2
 
3
3
  "test-comment": function() {
4
- return new tree.Combinator(' ');
4
+ return less.combinator(' ');
5
5
  },
6
- "test-directive": function(arg1, arg2) {
7
- return new tree.Directive(arg1.value, new tree.Anonymous(arg2.value));
6
+ "test-atrule": function(arg1, arg2) {
7
+ return less.atrule(arg1.value, arg2.value);
8
8
  },
9
9
  "test-extend": function() {
10
- //TODO
10
+ // TODO
11
11
  },
12
12
  "test-import": function() {
13
- //TODO
13
+ // TODO
14
14
  },
15
15
  "test-media": function() {
16
- //TODO
16
+ // TODO
17
17
  },
18
18
  "test-mixin-call": function() {
19
- //TODO
19
+ // TODO
20
20
  },
21
21
  "test-mixin-definition": function() {
22
- //TODO
22
+ // TODO
23
23
  },
24
24
  "test-ruleset-call": function() {
25
- return new tree.Combinator(' ');
25
+ return less.combinator(' ');
26
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);
27
+ // Functions must return something, even if it's false/true
28
+ "test-undefined": function() {
29
+ return;
33
30
  },
31
+ "test-collapse": function() {
32
+ return true;
33
+ },
34
+ // These cause root errors
34
35
  "test-assignment": function() {
35
- return new tree.Assignment("bird", "robin");
36
+ return less.assignment("bird", "robin");
36
37
  },
37
38
  "test-attribute": function() {
38
- return new tree.Attribute("foo", "=", "bar");
39
+ return less.attribute("foo", "=", "bar");
39
40
  },
40
41
  "test-call": function() {
41
- return new tree.Call("foo");
42
+ return less.call("foo");
42
43
  },
43
44
  "test-color": function() {
44
- return new tree.Color([50, 50, 50]);
45
+ return less.color([50, 50, 50]);
45
46
  },
46
47
  "test-condition": function() {
47
- return new tree.Condition('<', new tree.Value([0]), new tree.Value([1]));
48
+ return less.condition('<', less.value([0]), less.value([1]));
48
49
  },
49
50
  "test-detached-ruleset" : function() {
50
- var rule = new tree.Rule('prop', new tree.Anonymous('value'));
51
- return new tree.DetachedRuleset(new tree.Ruleset("", [ rule ]));
51
+ var decl = less.declaration('prop', 'value');
52
+ return less.detachedruleset(less.ruleset("", [ decl ]));
52
53
  },
53
54
  "test-dimension": function() {
54
- return new tree.Dimension(1, 'px');
55
+ return less.dimension(1, 'px');
55
56
  },
56
57
  "test-element": function() {
57
- return new tree.Element('+', 'a');
58
+ return less.element('+', 'a');
58
59
  },
59
60
  "test-expression": function() {
60
- return new tree.Expression([1, 2, 3]);
61
+ return less.expression([1, 2, 3]);
61
62
  },
62
63
  "test-keyword": function() {
63
- return new tree.Keyword('foo');
64
+ return less.keyword('foo');
64
65
  },
65
66
  "test-operation": function() {
66
- return new tree.Operation('+', [1, 2]);
67
+ return less.operation('+', [1, 2]);
67
68
  },
68
69
  "test-quoted": function() {
69
- return new tree.Quoted('"', 'foo');
70
+ return less.quoted('"', 'foo');
70
71
  },
71
72
  "test-selector": function() {
72
- return new tree.Selector([new tree.Element('a')]);
73
+ var sel = less.selector('.a.b');
74
+ return sel;
73
75
  },
74
76
  "test-url": function() {
75
- return new tree.URL('http://google.com');
77
+ return less.url('http://google.com');
76
78
  },
77
79
  "test-value": function() {
78
- return new tree.Value([1]);
80
+ return less.value([1]);
79
81
  }
80
82
  });
@@ -0,0 +1,7 @@
1
+ // Test NPM import
2
+ @plugin "clean-css";
3
+
4
+ a {
5
+ background: none;
6
+ }
7
+
@@ -1,5 +1,5 @@
1
1
  // importing plugin globally
2
- @plugin "./plugin/plugin-global";
2
+ @plugin "plugin/plugin-global";
3
3
 
4
4
  // transitively include plugins from importing another sheet
5
5
  @import "./plugin/plugin-transitive";
@@ -86,8 +86,38 @@
86
86
  .root {
87
87
  @ruleset2();
88
88
  }
89
+ .test-empty {
90
+ val1: foo;
91
+ test-collapse();
92
+ val2: foo;
93
+ }
94
+ .test-simple {
95
+ @plugin "./plugin/plugin-simple";
96
+ value: pi-anon();
97
+ value: (pi() * 2);
98
+ }
99
+ .test-conflicts {
100
+ @plugin "./plugin/plugin-scope1";
101
+ value: foo();
102
+ }
103
+ .test-conflicts {
104
+ @plugin "./plugin/plugin-scope2";
105
+ value: foo();
106
+ }
107
+ .test-conflicts {
108
+ @plugin "./plugin/plugin-scope1";
109
+ value: foo();
110
+ }
111
+ .test-collection {
112
+ @plugin "./plugin/plugin-collection";
113
+ @var: 32;
114
+ store(@var);
115
+ store(5);
116
+ store("bird");
117
+ list: list();
118
+ }
89
119
 
90
- test-directive("@charset"; '"utf-8"');
91
- test-directive("@arbitrary"; "value after ()");
120
+ test-atrule("@charset"; '"utf-8"');
121
+ test-atrule("@arbitrary"; "value after ()");
92
122
 
93
123
 
@@ -0,0 +1,67 @@
1
+
2
+ .block_1 {
3
+ color: red;
4
+ background-color: $color;
5
+ @width: 50px;
6
+ width: @width;
7
+ height: ($width / 2);
8
+ @color: red;
9
+ border: 1px solid lighten($color, 10%);
10
+ &:hover {
11
+ color: $color;
12
+ background-color: $color;
13
+ .mixin1();
14
+ }
15
+ .one {
16
+ background: $color;
17
+ }
18
+ content: "${color}";
19
+ prop: $color;
20
+
21
+ }
22
+
23
+ .block_2 {
24
+ color: red;
25
+ .two {
26
+ background-color: $color;
27
+ }
28
+ color: blue;
29
+ }
30
+
31
+ .block_3 {
32
+ color: red;
33
+ .three {
34
+ background-color: $color;
35
+ }
36
+ .mixin2();
37
+ color: blue;
38
+ }
39
+ .block_4 {
40
+ color: red;
41
+ .four {
42
+ background-color: $color;
43
+ }
44
+ color: blue;
45
+ .mixin2();
46
+ }
47
+ // property merging
48
+ a {
49
+ background-color+: red;
50
+ background-color+: foo;
51
+
52
+ &b {
53
+ background: $background-color;
54
+ }
55
+ }
56
+
57
+ .value_as_property {
58
+ prop1: color;
59
+ ${prop1}: #FF0000; // not sure why you'd want to do this, but ok
60
+ }
61
+
62
+ .mixin1() {
63
+ color: green;
64
+ }
65
+ .mixin2() {
66
+ color: yellow;
67
+ }
@@ -0,0 +1 @@
1
+ @charset "utf-8";
@@ -0,0 +1,3 @@
1
+ // https://github.com/less/less.js/issues/3112
2
+ @file: ext();
3
+ @import '@{file}';
File without changes
@@ -0,0 +1,7 @@
1
+ .no-math {
2
+ @var: 50vh/2;
3
+ width: calc(50% + (@var - 20px));
4
+ foo: 1 + 2 calc(3 + 4) 5 + 6;
5
+ @floor: floor(1 + .1);
6
+ bar: calc(@floor + 20%);
7
+ }
@@ -0,0 +1,15 @@
1
+ .wrapper {
2
+ display: grid;
3
+ grid-template-columns: [col1-start] 9fr [col1-end] 10px [col2-start] 3fr [col2-end];
4
+ grid-template-rows: auto;
5
+ }
6
+
7
+ .wrapper {
8
+ display: grid;
9
+ grid-template-columns: 9fr 1.875em 3fr;
10
+ grid-template-rows: auto;
11
+ grid-template-areas:
12
+ "header header header"
13
+ "content . sidebar"
14
+ "footer footer footer";
15
+ }
@@ -31,8 +31,8 @@
31
31
  .wrap-mixin(@ruleset);
32
32
 
33
33
  .desktop-and-old-ie(@rules) {
34
- @media screen and (min-width: 1200) { @rules(); }
35
- html.lt-ie9 & { @rules(); }
34
+ @media screen and (min-width: 1200) { @rules() }
35
+ html.lt-ie9 & { @rules() }
36
36
  }
37
37
 
38
38
  header {
@@ -1,3 +1,4 @@
1
1
  .a {
2
2
  @wrongHEXColorCode: #DCALLB;
3
+ color: @wrongHEXColorCode;
3
4
  }
@@ -1,4 +1,4 @@
1
1
  SyntaxError: Invalid HEX color code in {path}color-invalid-hex-code.less on line 2, column 29:
2
2
  1 .a {
3
3
  2 @wrongHEXColorCode: #DCALLB;
4
- 3 }
4
+ 3 color: @wrongHEXColorCode;
@@ -1,3 +1,4 @@
1
1
  .a {
2
2
  @wrongHEXColorCode: #fffblack;
3
+ color: @wrongHEXColorCode;
3
4
  }
@@ -1,4 +1,4 @@
1
1
  SyntaxError: Invalid HEX color code in {path}color-invalid-hex-code2.less on line 2, column 29:
2
2
  1 .a {
3
3
  2 @wrongHEXColorCode: #fffblack;
4
- 3 }
4
+ 3 color: @wrongHEXColorCode;
@@ -1,3 +1,3 @@
1
- FileError: '{pathhref}file-does-not-exist.less' wasn't found{404status}{node}. Tried - {path}file-does-not-exist.less,{pathrel}file-does-not-exist.less,file-does-not-exist.less{/node} in {path}import-missing.less on line 6, column 1:
1
+ FileError: '{pathhref}file-does-not-exist.less' wasn't found{404status}{node}. Tried - {path}file-does-not-exist.less,{pathrel}file-does-not-exist.less,{nodepath}file-does-not-exist.less,file-does-not-exist.less{/node} in {path}import-missing.less on line 6, column 1:
2
2
  5
3
3
  6 @import "file-does-not-exist.less";
@@ -0,0 +1,5 @@
1
+ registerPlugin({
2
+ use: function() {
3
+ throw new Error("An error was here.")
4
+ }
5
+ });
@@ -0,0 +1,5 @@
1
+ registerPlugin({
2
+ eval: function() {
3
+ throw new Error("An error was here.")
4
+ }
5
+ });
@@ -0,0 +1 @@
1
+ throw new Error('Error');
@@ -0,0 +1 @@
1
+ @plugin "plugin/plugin-error";
@@ -0,0 +1,2 @@
1
+ SyntaxError: Error in {path}plugin-error.js{node} on line 1, column 8:
2
+ 1 throw new Error('Error');{/node}
@@ -0,0 +1 @@
1
+ @plugin "plugin/plugin-error-2";
@@ -0,0 +1,5 @@
1
+ SyntaxError: Error during @plugin call in {path}plugin-error-2.js{node} on line 3, column 16:
2
+ 2 use: function() {
3
+ 3 throw new Error("An error was here.")
4
+ 4 }
5
+ {/node}
@@ -0,0 +1 @@
1
+ @plugin "plugin/plugin-error-3";
@@ -0,0 +1,5 @@
1
+ SyntaxError: Plugin error during evaluation in {path}plugin-error-3.js{node} on line 3, column 16:
2
+ 2 eval: function() {
3
+ 3 throw new Error("An error was here.")
4
+ 4 }
5
+ {/node}
@@ -230,3 +230,21 @@ html {
230
230
  color: mix(blue, @color1, 50%);
231
231
  color: mix(blue, @color2, 50%);
232
232
  }
233
+
234
+ #boolean {
235
+ a: boolean(not(2 < 1));
236
+ b: boolean(not(2 > 1) and (true));
237
+ c: boolean(not(boolean((true))));
238
+ }
239
+
240
+ #if {
241
+ a: if(not(false), 1, 2);
242
+ b: if(not(true), 1, 2);
243
+ @1: if(not(false), {c: 3}, {d: 4}); @1();
244
+
245
+ e: if(not(true), 5);
246
+ @f: boolean((3 = 4));
247
+ f: if(not(@f), 6);
248
+
249
+ if((false), {g: 7}); /* results in void */
250
+ }
@@ -0,0 +1,3 @@
1
+ @import "import-module/one/two/three/3.less";
2
+ @import "import-module/one/two/2";
3
+ @import "import-module/one/1.less";
@@ -1,6 +1,4 @@
1
1
  /** comment at the top**/
2
- @import url(http://fonts.googleapis.com/css?family=Open+Sans);
3
-
4
2
  @import url(/absolute/something.css) screen and (color) and (max-width: 600px);
5
3
 
6
4
  @import (optional) "file-does-not-exist.does-not-exist";
@@ -1,4 +1,4 @@
1
- @media (-o-min-device-pixel-ratio: 2/1) {
1
+ @media (-o-min-device-pixel-ratio: 2) {
2
2
  .test-math-and-units {
3
3
  font: ignores 0/0 rules;
4
4
  test-division: 4 / 2 + 5em;
@@ -23,7 +23,7 @@
23
23
  @ratio_large: 16;
24
24
  @ratio_small: 9;
25
25
 
26
- @media all and (device-aspect-ratio: @ratio_large / @ratio_small) {
26
+ @media all and (device-aspect-ratio: ~"@{ratio_large} / @{ratio_small}") {
27
27
  body { max-width: 800px; }
28
28
  }
29
29
 
@@ -177,7 +177,7 @@ body {
177
177
  }
178
178
  }
179
179
 
180
- @media (-webkit-min-device-pixel-ratio: 2), (min--moz-device-pixel-ratio: 2), (-o-min-device-pixel-ratio: 2/1), (min-resolution: 2dppx), (min-resolution: 128dpcm) {
180
+ @media (-webkit-min-device-pixel-ratio: 2), (min--moz-device-pixel-ratio: 2), (-o-min-device-pixel-ratio: ~"2/1"), (min-resolution: 2dppx), (min-resolution: 128dpcm) {
181
181
  .b {
182
182
  background: red;
183
183
  }
@@ -36,17 +36,20 @@
36
36
  .first-background();
37
37
  }
38
38
  .test4 {
39
- // Won't merge values from sources that merked as !important, for backwards compatibility with css
40
39
  .first-transform();
41
40
  .fifth-transform();
42
41
  }
43
42
  .test5 {
44
- // Won't merge values from mixins that merked as !important, for backwards compatibility with css
45
43
  .first-transform();
46
44
  .second-transform() !important;
47
45
  }
48
46
  .test6 {
49
- // Ignores !merge if no peers found
47
+ .second-transform();
48
+ }
49
+ .test7 {
50
+ // inherit !important from merged subrules
51
+ .second-transform();
52
+ .second-transform() !important;
50
53
  .second-transform();
51
54
  }
52
55
 
@@ -0,0 +1,9 @@
1
+ var collection = [];
2
+
3
+ functions.add('store', function(val) {
4
+ collection.push(val); // imma store this for later
5
+ return false;
6
+ });
7
+ functions.add('list', function() {
8
+ return less.value(collection);
9
+ });
@@ -7,8 +7,8 @@ functions.addMultiple({
7
7
  }
8
8
  });
9
9
 
10
- return {
10
+ registerPlugin({
11
11
  setOptions: function(raw) {
12
12
  // do nothing
13
13
  }
14
- }
14
+ });
@@ -0,0 +1,3 @@
1
+ functions.add('foo', function() {
2
+ return "foo";
3
+ });
@@ -0,0 +1,3 @@
1
+ functions.add('foo', function() {
2
+ return "bar";
3
+ });
@@ -0,0 +1,7 @@
1
+ functions.add('pi-anon', function() {
2
+ return Math.PI;
3
+ });
4
+
5
+ functions.add('pi', function() {
6
+ return less.dimension(Math.PI);
7
+ });