less 2.5.1 → 2.6.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 (150) hide show
  1. package/.travis.yml +3 -2
  2. package/CHANGELOG.md +41 -0
  3. package/Gruntfile.js +5 -10
  4. package/README.md +3 -3
  5. package/appveyor.yml +2 -2
  6. package/bin/lessc +1 -0
  7. package/bower.json +1 -2
  8. package/dist/less.js +969 -605
  9. package/dist/less.min.js +13 -9
  10. package/gradlew +0 -0
  11. package/lib/less/contexts.js +0 -1
  12. package/lib/less/functions/color.js +5 -2
  13. package/lib/less/functions/math-helper.js +16 -0
  14. package/lib/less/functions/math.js +4 -16
  15. package/lib/less/functions/number.js +7 -2
  16. package/lib/less/index.js +1 -1
  17. package/lib/less/parser/parser-input.js +68 -68
  18. package/lib/less/parser/parser.js +159 -75
  19. package/lib/less/transform-tree.js +1 -0
  20. package/lib/less/tree/anonymous.js +4 -2
  21. package/lib/less/tree/color.js +4 -1
  22. package/lib/less/tree/comment.js +2 -6
  23. package/lib/less/tree/directive.js +3 -18
  24. package/lib/less/tree/element.js +9 -2
  25. package/lib/less/tree/extend.js +10 -5
  26. package/lib/less/tree/import.js +23 -5
  27. package/lib/less/tree/media.js +4 -2
  28. package/lib/less/tree/mixin-call.js +31 -18
  29. package/lib/less/tree/mixin-definition.js +19 -7
  30. package/lib/less/tree/node.js +49 -0
  31. package/lib/less/tree/rule.js +1 -1
  32. package/lib/less/tree/ruleset.js +107 -125
  33. package/lib/less/tree/selector.js +4 -9
  34. package/lib/less/tree/unit.js +2 -2
  35. package/lib/less/visitors/extend-visitor.js +17 -8
  36. package/lib/less/visitors/import-visitor.js +5 -0
  37. package/lib/less/visitors/index.js +1 -0
  38. package/lib/less/visitors/set-tree-visibility-visitor.js +38 -0
  39. package/lib/less/visitors/to-css-visitor.js +181 -98
  40. package/lib/less-browser/bootstrap.js +28 -2
  41. package/lib/less-browser/cache.js +11 -4
  42. package/lib/less-browser/error-reporting.js +10 -10
  43. package/lib/less-browser/file-manager.js +1 -1
  44. package/lib/less-browser/image-size.js +28 -0
  45. package/lib/less-browser/index.js +9 -10
  46. package/package.json +14 -14
  47. package/test/browser/less/errors/image-height-error.less +3 -0
  48. package/test/browser/less/errors/image-height-error.txt +4 -0
  49. package/test/browser/less/errors/image-size-error.less +3 -0
  50. package/test/browser/less/errors/image-size-error.txt +4 -0
  51. package/test/browser/less/errors/image-width-error.less +3 -0
  52. package/test/browser/less/errors/image-width-error.txt +4 -0
  53. package/test/browser/less.js +23 -19
  54. package/test/css/comments2.css +7 -1
  55. package/test/css/compression/compression.css +1 -1
  56. package/test/css/css-3.css +6 -0
  57. package/test/css/extend-selector.css +7 -0
  58. package/test/css/extract-and-length.css +1 -1
  59. package/test/css/functions.css +3 -3
  60. package/test/css/import-reference-issues.css +24 -0
  61. package/test/css/import-reference.css +5 -1
  62. package/test/css/include-path/include-path.css +1 -1
  63. package/test/css/include-path-string/include-path-string.css +1 -1
  64. package/test/css/mixins-args.css +51 -1
  65. package/test/css/mixins-guards.css +36 -0
  66. package/test/css/no-strict-math/mixins-guards.css +12 -0
  67. package/test/css/no-strict-math/no-sm-operations.css +12 -0
  68. package/test/css/operations.css +1 -0
  69. package/test/css/scope.css +1 -1
  70. package/test/css/strings.css +1 -1
  71. package/test/css/url-args/urls.css +5 -5
  72. package/test/css/urls.css +8 -8
  73. package/test/css/variables.css +5 -5
  74. package/test/data/image.jpg +0 -0
  75. package/test/data/image.svg +2 -1
  76. package/test/data/page.html +1 -1
  77. package/test/index.js +1 -0
  78. package/test/less/comments2.less +11 -0
  79. package/test/less/css-3.less +10 -2
  80. package/test/less/errors/at-rules-undefined-var.txt +4 -4
  81. package/test/less/errors/css-guard-default-func.txt +4 -4
  82. package/test/less/errors/javascript-undefined-var.txt +4 -4
  83. package/test/less/errors/mixins-guards-default-func-1.txt +4 -4
  84. package/test/less/errors/mixins-guards-default-func-2.txt +4 -4
  85. package/test/less/errors/mixins-guards-default-func-3.txt +4 -4
  86. package/test/less/errors/parse-error-media-no-block-1.txt +1 -1
  87. package/test/less/errors/parse-error-media-no-block-2.txt +1 -1
  88. package/test/less/errors/parse-error-media-no-block-3.txt +1 -1
  89. package/test/less/errors/percentage-non-number-argument.less +3 -0
  90. package/test/less/errors/percentage-non-number-argument.txt +4 -0
  91. package/test/less/errors/property-interp-not-defined.txt +2 -2
  92. package/test/less/extend-selector.less +12 -1
  93. package/test/less/import/import-inline-invalid-css.less +1 -0
  94. package/test/less/import/import-reference.less +10 -1
  95. package/test/less/import-reference-issues/appender-reference-1968.less +6 -0
  96. package/test/less/import-reference-issues/global-scope-import.less +13 -0
  97. package/test/less/import-reference-issues/global-scope-nested.less +3 -0
  98. package/test/less/import-reference-issues/mixin-1968.less +8 -0
  99. package/test/less/import-reference-issues/multiple-import-nested.less +12 -0
  100. package/test/less/import-reference-issues/multiple-import.less +10 -0
  101. package/test/less/import-reference-issues/simple-mixin.css +3 -0
  102. package/test/less/import-reference-issues/simple-ruleset-2162.less +3 -0
  103. package/test/less/import-reference-issues.less +50 -0
  104. package/test/less/import-reference.less +2 -0
  105. package/test/less/mixins-args.less +48 -0
  106. package/test/less/mixins-guards.less +78 -0
  107. package/test/less/no-strict-math/mixins-guards.less +25 -0
  108. package/test/less/no-strict-math/no-sm-operations.less +10 -0
  109. package/test/less/operations.less +1 -0
  110. package/test/less-bom/comments2.less +11 -0
  111. package/test/less-bom/css-3.less +10 -2
  112. package/test/less-bom/errors/at-rules-undefined-var.txt +4 -4
  113. package/test/less-bom/errors/css-guard-default-func.txt +4 -4
  114. package/test/less-bom/errors/javascript-undefined-var.txt +4 -4
  115. package/test/less-bom/errors/mixins-guards-default-func-1.txt +4 -4
  116. package/test/less-bom/errors/mixins-guards-default-func-2.txt +4 -4
  117. package/test/less-bom/errors/mixins-guards-default-func-3.txt +4 -4
  118. package/test/less-bom/errors/parse-error-media-no-block-1.txt +1 -1
  119. package/test/less-bom/errors/parse-error-media-no-block-2.txt +1 -1
  120. package/test/less-bom/errors/parse-error-media-no-block-3.txt +1 -1
  121. package/test/less-bom/errors/percentage-non-number-argument.less +3 -0
  122. package/test/less-bom/errors/percentage-non-number-argument.txt +4 -0
  123. package/test/less-bom/errors/property-interp-not-defined.txt +2 -2
  124. package/test/less-bom/extend-selector.less +12 -1
  125. package/test/less-bom/import/import-inline-invalid-css.less +1 -0
  126. package/test/less-bom/import/import-reference.less +10 -1
  127. package/test/less-bom/import-reference-issues/appender-reference-1968.less +6 -0
  128. package/test/less-bom/import-reference-issues/global-scope-import.less +13 -0
  129. package/test/less-bom/import-reference-issues/global-scope-nested.less +3 -0
  130. package/test/less-bom/import-reference-issues/mixin-1968.less +8 -0
  131. package/test/less-bom/import-reference-issues/multiple-import-nested.less +12 -0
  132. package/test/less-bom/import-reference-issues/multiple-import.less +10 -0
  133. package/test/less-bom/import-reference-issues/simple-mixin.css +3 -0
  134. package/test/less-bom/import-reference-issues/simple-ruleset-2162.less +3 -0
  135. package/test/less-bom/import-reference-issues.less +50 -0
  136. package/test/less-bom/import-reference.less +2 -0
  137. package/test/less-bom/mixins-args.less +48 -0
  138. package/test/less-bom/mixins-guards.less +78 -0
  139. package/test/less-bom/no-strict-math/mixins-guards.less +25 -0
  140. package/test/less-bom/no-strict-math/no-sm-operations.less +10 -0
  141. package/test/less-bom/operations.less +1 -0
  142. package/test/less-test.js +6 -1
  143. package/.idea/.name +0 -1
  144. package/.idea/jsLibraryMappings.xml +0 -6
  145. package/.idea/less.js.iml +0 -9
  146. package/.idea/libraries/less_js_node_modules.xml +0 -14
  147. package/.idea/misc.xml +0 -14
  148. package/.idea/modules.xml +0 -8
  149. package/.idea/vcs.xml +0 -6
  150. package/.idea/workspace.xml +0 -281
package/.travis.yml CHANGED
@@ -1,8 +1,8 @@
1
1
  language: node_js
2
2
  node_js:
3
- - "iojs"
3
+ - "4.2.0"
4
+ - "4.0.0"
4
5
  - "0.12"
5
- - "0.11"
6
6
  - "0.10"
7
7
  install:
8
8
  - npm install -g grunt-cli
@@ -11,3 +11,4 @@ env:
11
11
  global:
12
12
  - secure: TrNVruWYaUK5ALga1y7wRY+MLjWJECUSCsBmKW5EUmIevOUxqHWu7M89FANKxstEeFRRAGH3QJbloRxnzIgh0U0ah5npE9XA1bYXGO5khoXeIyk7pNRfjIo8aEnJH1Vp8vWA6J6ovxdJ7lCFKEGvGKxGde50knVl7KFVVULlX2U=
13
13
  - secure: Rzh+CEI7YRvvVkOruPE8Z0dkU0s13V6b6cpqbN72vxbJl/Jm5PUZkjTFJdkWJrW3ErhCKX6EC7XdGvrclqEA9WAqKzrecqCJYqTnw4MwqiAj6F9wqE/BqhoWg4xPxm0MK/7eJMvLCgjNpe+gc1CaeFJZkLSNWn6nOFke+vVlf9Q=
14
+ sudo: false
package/CHANGELOG.md CHANGED
@@ -1,3 +1,44 @@
1
+ # 2.6.1
2
+
3
+ 2016-03-04
4
+
5
+ - Update Less.js dependencies
6
+ - Fix comments after named color regression
7
+ - use instanceof operator instead of class comparison optimization
8
+ - disallow whitespace in variable calls
9
+
10
+ # 2.6.0
11
+
12
+ 2016-01-29
13
+
14
+ - Underscore now allowed in dimension unit
15
+ - Fixes for import by reference
16
+ - Fix for #2384 Changes HTTPRequest "sync" setting to simply hide the page until less has rendered, browser version is now orders of magnitude faster.
17
+ - Added ability to cache stylesheets while using modifyVars
18
+ - Error when when image-size functions are used in browser-less
19
+ - Fixed extend leaking through nested parent selector. #2586
20
+ - Added "or" keyword and allowed arbitrary logical expression in guards
21
+ - Fixing #2124 - Parsing Error "Unrecognised input" for color operations
22
+ - Logical operator ```and``` now has higher precedence than logical operator ```or```.
23
+ - Allow unknown at-rules w/o {} block
24
+
25
+ # 2.5.3
26
+
27
+ 2015-09-25
28
+
29
+ - Fix import inline a URL
30
+
31
+ # 2.5.2
32
+
33
+ 2015-09-24
34
+
35
+ - No output should result in an empty sourcemap
36
+ - Import inline located inside file imported by reference should not be present in output
37
+ - Shorthand colors will stay shorthand
38
+ - Make percentage work like other math functions and throw an error on NaN
39
+ - Fixed mixin definition matching problem when mixin definition contains parameters with default values
40
+ - Observe reference for imported comments
41
+
1
42
  # 2.5.1
2
43
 
3
44
  2015-05-21
package/Gruntfile.js CHANGED
@@ -1,5 +1,4 @@
1
1
  'use strict';
2
- var fs = require('fs');
3
2
 
4
3
  module.exports = function (grunt) {
5
4
 
@@ -171,7 +170,7 @@ module.exports = function (grunt) {
171
170
  }
172
171
  },
173
172
  errors: {
174
- src: ['test/less/errors/*.less', '!test/less/errors/javascript-error.less'],
173
+ src: ['test/less/errors/*.less', '!test/less/errors/javascript-error.less', 'test/browser/less/errors/*.less'],
175
174
  options: {
176
175
  timeout: 20000,
177
176
  helpers: 'test/browser/runner-errors-options.js',
@@ -361,18 +360,11 @@ module.exports = function (grunt) {
361
360
  'test'
362
361
  ]);
363
362
 
364
- grunt.registerTask('updateBowerJson', function () {
365
- var bowerJson = require('./bower.json');
366
- bowerJson.version = grunt.config('pkg.version');
367
- fs.writeFileSync('./bower.json', JSON.stringify(bowerJson, null, 2));
368
- });
369
-
370
363
  // Release
371
364
  grunt.registerTask('dist', [
372
365
  'browserify:browser',
373
366
  'concat:dist',
374
- 'uglify:dist',
375
- 'updateBowerJson'
367
+ 'uglify:dist'
376
368
  ]);
377
369
 
378
370
  // Release Rhino Version
@@ -449,6 +441,9 @@ module.exports = function (grunt) {
449
441
  // Run all tests
450
442
  grunt.registerTask('test', testTasks);
451
443
 
444
+ // Run all tests
445
+ grunt.registerTask('quicktest', testTasks.slice(0, testTasks.length -1));
446
+
452
447
  // generate a good test environment for testing sourcemaps
453
448
  grunt.registerTask('sourcemap-test', [
454
449
  'clean:sourcemap-test',
package/README.md CHANGED
@@ -4,12 +4,12 @@
4
4
 
5
5
  # [Less.js](http://lesscss.org)
6
6
 
7
- [![Join the chat at https://gitter.im/less/less.js](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/less/less.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
8
-
9
7
  > The **dynamic** stylesheet language. [http://lesscss.org](http://lesscss.org).
10
8
 
11
9
  This is the JavaScript, official, stable version of Less.
12
10
 
11
+ ###### :point_right: [![Join the chat at https://gitter.im/less/less.js](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/less/less.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) <sup>Chat with Less.js users</sup>
12
+
13
13
 
14
14
  ## Getting Started
15
15
 
@@ -47,7 +47,7 @@ See the [changelog](CHANGELOG.md)
47
47
 
48
48
  ## [License](LICENSE)
49
49
 
50
- Copyright (c) 2009-2014 [Alexis Sellier](http://cloudhead.io) & The Core Less Team
50
+ Copyright (c) 2009-2016 [Alexis Sellier](http://cloudhead.io) & The Core Less Team
51
51
  Licensed under the [Apache License](LICENSE).
52
52
 
53
53
 
package/appveyor.yml CHANGED
@@ -3,6 +3,7 @@ environment:
3
3
  matrix:
4
4
  - nodejs_version: "0.10"
5
5
  - nodejs_version: "0.12"
6
+ - nodejs_version: "4"
6
7
 
7
8
  # Install scripts. (runs after repo cloning)
8
9
  install:
@@ -20,8 +21,7 @@ install:
20
21
  # Post-install test scripts.
21
22
  test_script:
22
23
  # Output useful info for debugging.
23
- - node --version
24
- - npm --version
24
+ - node --version && npm --version
25
25
  # Run test
26
26
  - grunt test
27
27
 
package/bin/lessc CHANGED
@@ -353,6 +353,7 @@ function printUsage() {
353
353
 
354
354
  if (!sourceMapFileInline) {
355
355
  var writeSourceMap = function(output, onDone) {
356
+ output = output || "";
356
357
  var filename = sourceMapOptions.sourceMapFullFilename;
357
358
  ensureDirectory(filename);
358
359
  fs.writeFile(filename, output, 'utf8', function (err) {
package/bower.json CHANGED
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "name": "less",
3
- "version": "2.5.1",
4
3
  "main": "dist/less.js",
5
4
  "ignore": [
6
5
  "**/.*",
@@ -22,4 +21,4 @@
22
21
  ".jshintrc",
23
22
  ".npmignore"
24
23
  ]
25
- }
24
+ }