less 1.7.0 → 1.7.5

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 (109) hide show
  1. package/.grunt/grunt-contrib-jasmine/es5-shim.js +1360 -0
  2. package/.idea/jsLibraryMappings.xml +0 -1
  3. package/.idea/workspace.xml +182 -183
  4. package/.travis.yml +0 -1
  5. package/CHANGELOG.md +60 -2
  6. package/CONTRIBUTING.md +1 -1
  7. package/Gruntfile.js +12 -24
  8. package/LICENSE +0 -2
  9. package/README.md +5 -3
  10. package/benchmark/less-benchmark.js +1 -2
  11. package/bin/lessc +13 -11
  12. package/bower.json +2 -2
  13. package/build/rhino-modules.js +1 -1
  14. package/dist/less-1.7.0.js +59 -59
  15. package/dist/less-1.7.0.min.js +12 -12
  16. package/dist/less-1.7.1.js +7936 -0
  17. package/dist/less-1.7.1.min.js +16 -0
  18. package/dist/less-1.7.2.js +7938 -0
  19. package/dist/less-1.7.2.min.js +16 -0
  20. package/dist/less-1.7.3.js +7942 -0
  21. package/dist/less-1.7.3.min.js +16 -0
  22. package/dist/less-1.7.4.js +7979 -0
  23. package/dist/less-1.7.4.min.js +16 -0
  24. package/dist/less-1.7.5.js +8008 -0
  25. package/dist/less-1.7.5.min.js +16 -0
  26. package/dist/less-rhino-1.7.0.js +48 -48
  27. package/dist/less-rhino-1.7.1.js +9311 -0
  28. package/dist/less-rhino-1.7.2.js +9313 -0
  29. package/dist/less-rhino-1.7.3.js +9317 -0
  30. package/dist/less-rhino-1.7.4.js +9354 -0
  31. package/dist/less-rhino-1.7.5.js +9383 -0
  32. package/dist/lessc-rhino-1.7.0.js +2 -2
  33. package/dist/lessc-rhino-1.7.1.js +449 -0
  34. package/dist/lessc-rhino-1.7.2.js +449 -0
  35. package/dist/lessc-rhino-1.7.3.js +449 -0
  36. package/dist/lessc-rhino-1.7.4.js +449 -0
  37. package/dist/lessc-rhino-1.7.5.js +449 -0
  38. package/lib/less/browser.js +14 -9
  39. package/lib/less/env.js +2 -0
  40. package/lib/less/fs.js +10 -0
  41. package/lib/less/functions.js +41 -38
  42. package/lib/less/import-visitor.js +9 -7
  43. package/lib/less/index.js +30 -18
  44. package/lib/less/lessc_helper.js +1 -0
  45. package/lib/less/parser/parser.js.orig +1747 -0
  46. package/lib/less/parser.js +81 -40
  47. package/lib/less/rhino.js +3 -3
  48. package/lib/less/source-map-output.js +1 -1
  49. package/lib/less/to-css-visitor.js +3 -0
  50. package/lib/less/tree/anonymous.js +7 -3
  51. package/lib/less/tree/directive.js +6 -0
  52. package/lib/less/tree/element.js +6 -22
  53. package/lib/less/tree/import.js +1 -1
  54. package/lib/less/tree/mixin.js +4 -3
  55. package/lib/less/tree/quoted.js +12 -4
  56. package/lib/less/tree/rule.js +7 -4
  57. package/lib/less/tree/rule.js.orig +164 -0
  58. package/lib/less/tree/ruleset.js +27 -2
  59. package/lib/less/tree/selector.js +1 -1
  60. package/lib/less/tree.js +2 -2
  61. package/package.json +13 -12
  62. package/test/browser/less.js +7317 -6931
  63. package/test/css/comments.css +8 -0
  64. package/test/css/css-3.css +9 -0
  65. package/test/css/functions.css +8 -8
  66. package/test/css/import-inline.css +4 -1
  67. package/test/css/import.css +6 -0
  68. package/test/css/javascript.css +5 -0
  69. package/test/css/mixins-guards.css +14 -3
  70. package/test/css/mixins.css +3 -0
  71. package/test/css/property-name-interp.css +1 -0
  72. package/test/css/urls.css +6 -0
  73. package/test/index.js +1 -1
  74. package/test/less/comments.less +14 -1
  75. package/test/less/css-3.less +12 -1
  76. package/test/less/errors/color-invalid-hex-code.less +3 -0
  77. package/test/less/errors/color-invalid-hex-code.txt +4 -0
  78. package/test/less/errors/color-invalid-hex-code2.less +3 -0
  79. package/test/less/errors/color-invalid-hex-code2.txt +4 -0
  80. package/test/less/errors/import-malformed.less +1 -0
  81. package/test/less/errors/import-malformed.txt +3 -0
  82. package/test/less/errors/import-no-semi.txt +1 -1
  83. package/test/less/errors/javascript-error.less +1 -1
  84. package/test/less/errors/javascript-error.txt +2 -2
  85. package/test/less/import-inline.less +1 -0
  86. package/test/less/import.less +8 -1
  87. package/test/less/javascript.less +9 -0
  88. package/test/less/mixins-guards.less +17 -3
  89. package/test/less/mixins.less +4 -0
  90. package/test/less/property-name-interp.less +4 -1
  91. package/test/less/property-name-interp.less.orig +59 -0
  92. package/test/less/urls.less +12 -0
  93. package/test/less-test.js +7 -8
  94. package/test/modify-vars.js +17 -0
  95. package/test/sourcemaps/basic.json +1 -1
  96. package/tmp/browser/test-runner-main.html +4 -0
  97. package/tmp/less.js +8295 -0
  98. package/build/README.md +0 -51
  99. package/tmp/browser/test-postProcessor.html +0 -59
  100. package/tmp/browser/test-runner-browser.html +0 -59
  101. package/tmp/browser/test-runner-errors.html +0 -267
  102. package/tmp/browser/test-runner-global-vars.html +0 -59
  103. package/tmp/browser/test-runner-legacy.html +0 -59
  104. package/tmp/browser/test-runner-modify-vars.html +0 -59
  105. package/tmp/browser/test-runner-no-js-errors.html +0 -59
  106. package/tmp/browser/test-runner-production.html +0 -55
  107. package/tmp/browser/test-runner-relative-urls.html +0 -59
  108. package/tmp/browser/test-runner-rootpath-relative.html +0 -59
  109. package/tmp/browser/test-runner-rootpath.html +0 -59
package/.travis.yml CHANGED
@@ -2,7 +2,6 @@ language: node_js
2
2
  node_js:
3
3
  - "0.11"
4
4
  - "0.10"
5
- - "0.8"
6
5
  install:
7
6
  - npm install -g grunt-cli
8
7
  - npm install
package/CHANGELOG.md CHANGED
@@ -1,3 +1,61 @@
1
+ # 1.7.5
2
+
3
+ 2014-09-03
4
+
5
+ - Allow comments in keyframe (complete comment support coming in 2.0)
6
+ - pass options to parser from less.render
7
+ - Support /deep/ combinator
8
+ - handle fragments in data-uri's
9
+ - float @charsets to the top correctly
10
+ - updates to some dependencies
11
+ - Fix interpolated import in media query
12
+ - A few other various small corrections
13
+
14
+ # 1.7.4
15
+
16
+ 2014-07-27
17
+
18
+ - Handle uppercase paths in browser
19
+ - Show error if an empty selector is used in extend
20
+ - Fix property merging in directives
21
+ - Fix ordering of charset and import directives
22
+ - Fix race condition that caused a rules is undefined error sometimes if you had a complex import strategy
23
+ - Better error message for imports missing semi-colons or malformed
24
+ - Do not use util.print to avoid deprecate warnings in node 0.11
25
+
26
+ # 1.7.3
27
+
28
+ 2014-06-22
29
+
30
+ - Include dist files, missing from 1.7.2
31
+ - Do not round the results of color functions, like lightness, hue, luma etc.
32
+ - Support cover and contain keywords in background definitions
33
+
34
+ # 1.7.2
35
+
36
+ 2014-06-19
37
+
38
+ - Allow paths option to be a string (in 1.7.1 less started throwing an exception instead of incorrectly processing the string as an array of chars)
39
+ - Do not round numbers when used with javascript (introduced 1.7.0)
40
+
41
+ # 1.7.1
42
+
43
+ 2014-06-08
44
+
45
+ - Fix detection of recursive mixins
46
+ - Fix the paths option for later versions of node (0.10+)
47
+ - Fix paths joining bug
48
+ - Fix a number precision issue on some versions of node
49
+ - Fix an IE8 issue with importing css files
50
+ - Fix IE11 detection for xhr requests
51
+ - Modify var works if the last line of a less file is a comment.
52
+ - Better detection of valid hex colour codes
53
+ - Some stability fixes to support a low number of available file handles
54
+ - Support comparing values with different quote types e.g. "test" now === 'test'
55
+ - Give better error messages if accessing a url that returns a non 200 status code
56
+ - Fix the e() function when passed empty string
57
+ - Several minor bug fixes
58
+
1
59
  # 1.7.0
2
60
 
3
61
  2014-02-27
@@ -135,7 +193,7 @@
135
193
  - fix passing of strict maths option
136
194
 
137
195
  # 1.4.0 Beta 4
138
-
196
+
139
197
  2013-05-04
140
198
 
141
199
  - change strictMaths to strictMath. Enable this with --strict-math=on in lessc and strictMath:true in JavaScript.
@@ -168,7 +226,7 @@
168
226
  - significant bug fixes to our debug options
169
227
  - other parameters can be used as defaults in mixins e.g. .a(@a, @b:@a)
170
228
  - an error is shown if properties are used outside of a ruleset
171
- - added extract function which picks a value out of a list, e.g. extract(12 13 14, 3) => 14
229
+ - added extract function which picks a value out of a list, e.g. extract(12 13 14, 3) => 14
172
230
  - added luma, hsvhue, hsvsaturation, hsvvalue functions
173
231
  - added pow, pi, mod, tan, sin, cos, atan, asin, acos and sqrt math functions
174
232
  - added convert function, e.g. convert(1rad, deg) => value in degrees
package/CONTRIBUTING.md CHANGED
@@ -15,7 +15,7 @@ We only accept issues that are bug reports or feature requests. Bugs must be iso
15
15
  1. **Search for existing issues.** We get a lot of duplicate issues, and you'd help us out a lot by first checking if someone else has reported the same issue. Moreover, the issue may have already been resolved with a fix available.
16
16
  2. **Create an isolated and reproducible test case.** Be sure the problem exists in Less.js's code with [reduced test cases](http://css-tricks.com/reduced-test-cases/) that should be included in each bug report.
17
17
  3. **Test with the latest version**. We get a lot of issues that could be resolved by updating your version of Less.js.
18
- 3. **Include a live example.** Please use [less2css.org](http://less2css.org/) for sharing your isolated test cases.
18
+ 3. **Include an example with source.** E.g. You can use [less2css.org](http://less2css.org/) to create a short test case.
19
19
  4. **Share as much information as possible.** Include operating system and version. Describe how you use Less. If you use it in the browser, please include browser and version, and the version of Less.js you're using. Let us know if you're using the command line (`lessc`) or an external tool. And try to include steps to reproduce the bug.
20
20
  5. If you have a solution or suggestion for how to fix the bug you're reporting, please include it, or make a pull request - don't assume the maintainers know how to fix it just because you do.
21
21
 
package/Gruntfile.js CHANGED
@@ -15,17 +15,17 @@ module.exports = function(grunt) {
15
15
  license: '<%= _.pluck(pkg.licenses, "type").join(", ") %>',
16
16
  copyright: 'Copyright (c) 2009-<%= grunt.template.today("yyyy") %>',
17
17
  banner:
18
- '/*! \n' +
19
- ' * LESS - <%= pkg.description %> v<%= pkg.version %> \n' +
20
- ' * http://lesscss.org \n' +
21
- ' * \n' +
22
- ' * <%= meta.copyright %>, <%= pkg.author.name %> <<%= pkg.author.email %>> \n' +
23
- ' * Licensed under the <%= meta.license %> License. \n' +
24
- ' * \n' +
25
- ' */ \n\n' +
18
+ '/*!\n' +
19
+ ' * Less - <%= pkg.description %> v<%= pkg.version %>\n' +
20
+ ' * http://lesscss.org\n' +
21
+ ' *\n' +
22
+ ' * <%= meta.copyright %>, <%= pkg.author.name %> <<%= pkg.author.email %>>\n' +
23
+ ' * Licensed under the <%= meta.license %> License.\n' +
24
+ ' *\n' +
25
+ ' */\n\n' +
26
26
  ' /**' +
27
27
  ' * @license <%= meta.license %>\n' +
28
- ' */ \n\n'
28
+ ' */\n\n'
29
29
  },
30
30
 
31
31
  shell: {
@@ -64,7 +64,7 @@ module.exports = function(grunt) {
64
64
  // Rhino
65
65
  rhino: {
66
66
  options: {
67
- banner: '/* LESS.js v<%= pkg.version %> RHINO | <%= meta.copyright %>, <%= pkg.author.name %> <<%= pkg.author.email %>> */\n\n',
67
+ banner: '/* Less.js v<%= pkg.version %> RHINO | <%= meta.copyright %>, <%= pkg.author.name %> <<%= pkg.author.email %>> */\n\n',
68
68
  footer: '' // override task-level footer
69
69
  },
70
70
  src: ['<%= build.rhino %>'],
@@ -73,18 +73,11 @@ module.exports = function(grunt) {
73
73
  // lessc for Rhino
74
74
  rhinolessc: {
75
75
  options: {
76
- banner: '/* LESS.js v<%= pkg.version %> RHINO | <%= meta.copyright %>, <%= pkg.author.name %> <<%= pkg.author.email %>> */\n\n',
76
+ banner: '/* Less.js v<%= pkg.version %> RHINO | <%= meta.copyright %>, <%= pkg.author.name %> <<%= pkg.author.email %>> */\n\n',
77
77
  footer: '' // override task-level footer
78
78
  },
79
79
  src: ['<%= build.rhinolessc %>'],
80
80
  dest: 'dist/lessc-rhino-<%= pkg.version %>.js'
81
- },
82
- // Generate readme
83
- readme: {
84
- // override task-level banner and footer
85
- options: {process: true, banner: '', footer: ''},
86
- src: ['build/README.md'],
87
- dest: 'README.md'
88
81
  }
89
82
  },
90
83
 
@@ -254,7 +247,7 @@ module.exports = function(grunt) {
254
247
  'concat:rhino',
255
248
  'concat:rhinolessc'
256
249
  ]);
257
-
250
+
258
251
  // Run all browser tests
259
252
  grunt.registerTask('browsertest', [
260
253
  'browser',
@@ -290,9 +283,4 @@ module.exports = function(grunt) {
290
283
  grunt.registerTask('benchmark', [
291
284
  'shell:benchmark'
292
285
  ]);
293
-
294
- // Readme.
295
- grunt.registerTask('readme', [
296
- 'concat:readme'
297
- ]);
298
286
  };
package/LICENSE CHANGED
@@ -175,5 +175,3 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
175
175
  of your accepting any such warranty or additional liability.
176
176
 
177
177
  END OF TERMS AND CONDITIONS
178
-
179
- Copyright (c) 2009-2010 Alexis Sellier
package/README.md CHANGED
@@ -1,9 +1,11 @@
1
- [![Build Status](https://travis-ci.org/less/less.js.png?branch=master)](https://travis-ci.org/less/less.js)
2
- # [Less.js v1.6.3](http://lesscss.org)
1
+ [![NPM version](https://badge.fury.io/js/less.svg)](http://badge.fury.io/js/less) [![Build Status](https://travis-ci.org/less/less.js.png?branch=master)](https://travis-ci.org/less/less.js)
2
+ [![Dependencies](https://david-dm.org/less/less.js.png)](https://david-dm.org/less/less.js) [![devDependency Status](https://david-dm.org/less/less.js/dev-status.png)](https://david-dm.org/less/less.js#info=devDependencies) [![optionalDependency Status](https://david-dm.org/less/less.js/optional-status.png)](https://david-dm.org/less/less.js#info=optionalDependencies)
3
+
4
+ # [Less.js](http://lesscss.org)
3
5
 
4
6
  > The **dynamic** stylesheet language. [http://lesscss.org](http://lesscss.org).
5
7
 
6
- This is the JavaScript, and now official, stable version of Less.
8
+ This is the JavaScript, official, stable version of Less.
7
9
 
8
10
 
9
11
  ## Getting Started
@@ -1,6 +1,5 @@
1
1
  var path = require('path'),
2
- fs = require('fs'),
3
- sys = require('util');
2
+ fs = require('fs');
4
3
 
5
4
  var less = require('../lib/less');
6
5
  var file = path.join(__dirname, 'benchmark.less');
package/bin/lessc CHANGED
@@ -1,8 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  var path = require('path'),
4
- fs = require('fs'),
5
- sys = require('util'),
4
+ fs = require('../lib/less/fs'),
6
5
  os = require('os'),
7
6
  mkdirp;
8
7
 
@@ -79,7 +78,7 @@ args = args.filter(function (arg) {
79
78
  switch (arg) {
80
79
  case 'v':
81
80
  case 'version':
82
- console.log("lessc " + less.version.join('.') + " (LESS Compiler) [JavaScript]");
81
+ console.log("lessc " + less.version.join('.') + " (Less Compiler) [JavaScript]");
83
82
  continueProcessing = false;
84
83
  case 'verbose':
85
84
  options.verbose = true;
@@ -234,10 +233,13 @@ args = args.filter(function (arg) {
234
233
  case "--compatibility":
235
234
  cleancssOptions.compatibility = cleanOptionArgs[1];
236
235
  break;
236
+ case "--rounding-precision":
237
+ cleancssOptions.roundingPrecision = Number(cleanOptionArgs[1]);
238
+ break;
237
239
  default:
238
240
  console.log("unrecognised clean-css option '" + cleanOptionArgs[0] + "'");
239
241
  console.log("we support only arguments that make sense for less, '--keep-line-breaks', '-b'");
240
- console.log("'--s0', '--s1', '--advanced', '--skip-advanced', '--compatibility'");
242
+ console.log("'--s0', '--s1', '--advanced', '--skip-advanced', '--compatibility', '--rounding-precision'");
241
243
  continueProcessing = false;
242
244
  currentErrorcode = 1;
243
245
  break;
@@ -287,7 +289,7 @@ if (options.sourceMap === true) {
287
289
  }
288
290
 
289
291
  if (options.cleancss && options.sourceMap) {
290
- console.log("the sourcemap option is not compatible with sourcemap support at the moment. See Issue #1656");
292
+ console.log("the cleancss option is not compatible with sourcemap support at the moment. See Issue #1656");
291
293
  return;
292
294
  }
293
295
 
@@ -315,10 +317,10 @@ var ensureDirectory = function (filepath) {
315
317
 
316
318
  if (options.depends) {
317
319
  if (!outputbase) {
318
- sys.print("option --depends requires an output path to be specified");
320
+ console.log("option --depends requires an output path to be specified");
319
321
  return;
320
322
  }
321
- sys.print(outputbase + ": ");
323
+ process.stdout.write(outputbase + ": ");
322
324
  }
323
325
 
324
326
  if (!sourceMapFileInline) {
@@ -336,7 +338,7 @@ var parseLessFile = function (e, data) {
336
338
  return;
337
339
  }
338
340
 
339
- data = options.globalVariables + data + options.modifyVariables;
341
+ data = options.globalVariables + data + '\n' + options.modifyVariables;
340
342
 
341
343
  options.paths = [path.dirname(input)].concat(options.paths);
342
344
  options.filename = input;
@@ -349,9 +351,9 @@ var parseLessFile = function (e, data) {
349
351
  return;
350
352
  } else if (options.depends) {
351
353
  for(var file in parser.imports.files) {
352
- sys.print(file + " ")
354
+ process.stdout.write(file + " ")
353
355
  }
354
- sys.print("\n");
356
+ console.log("");
355
357
  } else {
356
358
  try {
357
359
  if (options.lint) { writeSourceMap = function() {} }
@@ -383,7 +385,7 @@ var parseLessFile = function (e, data) {
383
385
  console.log('lessc: wrote ' + output);
384
386
  }
385
387
  } else {
386
- sys.print(css);
388
+ process.stdout.write(css);
387
389
  }
388
390
  }
389
391
  } catch (e) {
package/bower.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "less",
3
- "version": "1.7.0",
4
- "main": "./dist/less-1.7.0.js",
3
+ "version": "1.7.5",
4
+ "main": "./dist/less-1.7.5.js",
5
5
  "ignore": [
6
6
  "**/.*",
7
7
  "benchmark",
@@ -50,7 +50,7 @@
50
50
  var result = [];
51
51
  for (i in parts) {
52
52
  var part = parts[i];
53
- if (part === '..' && result.length > 0) {
53
+ if (part === '..' && result.length > 0 && result[result.length-1] !== '..') {
54
54
  result.pop();
55
55
  } else if (part === '' && result.length > 0) {
56
56
  // skip