less 2.3.3 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. checksums.yaml +4 -4
  2. data/Changelog.md +5 -0
  3. data/less.gemspec +1 -1
  4. data/lib/less/js/.gitattributes +9 -0
  5. data/lib/less/js/.gitignore +1 -0
  6. data/lib/less/js/.npmignore +1 -1
  7. data/lib/less/js/CHANGELOG.md +68 -0
  8. data/lib/less/js/CONTRIBUTING.md +33 -34
  9. data/lib/less/js/Makefile +24 -9
  10. data/lib/less/js/README.md +2 -2
  11. data/lib/less/js/bin/lessc +102 -25
  12. data/lib/less/js/build/amd.js +1 -1
  13. data/lib/less/js/build/header.js +9 -7
  14. data/lib/less/js/dist/less-1.3.3.js +2 -2
  15. data/lib/less/js/dist/less-1.3.3.min.js +2 -2
  16. data/lib/less/js/dist/less-1.4.0-beta.js +5830 -0
  17. data/lib/less/js/dist/less-1.4.0-beta.min.js +11 -0
  18. data/lib/less/js/dist/less-1.4.0.js +5830 -0
  19. data/lib/less/js/dist/less-1.4.0.min.js +11 -0
  20. data/lib/less/js/dist/less-1.4.1.js +5837 -0
  21. data/lib/less/js/dist/less-1.4.1.min.js +11 -0
  22. data/lib/less/js/dist/less-1.4.2.js +5837 -0
  23. data/lib/less/js/dist/less-1.4.2.min.js +11 -0
  24. data/lib/less/js/dist/less-rhino-1.4.0.js +4273 -0
  25. data/lib/less/js/lib/less/browser.js +131 -101
  26. data/lib/less/js/lib/less/env.js +105 -0
  27. data/lib/less/js/lib/less/extend-visitor.js +391 -0
  28. data/lib/less/js/lib/less/functions.js +174 -19
  29. data/lib/less/js/lib/less/import-visitor.js +107 -0
  30. data/lib/less/js/lib/less/index.js +70 -63
  31. data/lib/less/js/lib/less/join-selector-visitor.js +37 -0
  32. data/lib/less/js/lib/less/lessc_helper.js +13 -4
  33. data/lib/less/js/lib/less/parser.js +353 -264
  34. data/lib/less/js/lib/less/rhino.js +5 -2
  35. data/lib/less/js/lib/less/tree.js +1 -1
  36. data/lib/less/js/lib/less/tree/alpha.js +7 -3
  37. data/lib/less/js/lib/less/tree/anonymous.js +1 -0
  38. data/lib/less/js/lib/less/tree/assignment.js +4 -0
  39. data/lib/less/js/lib/less/tree/call.js +14 -8
  40. data/lib/less/js/lib/less/tree/color.js +50 -5
  41. data/lib/less/js/lib/less/tree/comment.js +1 -0
  42. data/lib/less/js/lib/less/tree/condition.js +35 -28
  43. data/lib/less/js/lib/less/tree/dimension.js +270 -16
  44. data/lib/less/js/lib/less/tree/directive.js +7 -2
  45. data/lib/less/js/lib/less/tree/element.js +57 -21
  46. data/lib/less/js/lib/less/tree/expression.js +29 -4
  47. data/lib/less/js/lib/less/tree/extend.js +43 -0
  48. data/lib/less/js/lib/less/tree/import.js +49 -28
  49. data/lib/less/js/lib/less/tree/javascript.js +1 -0
  50. data/lib/less/js/lib/less/tree/keyword.js +3 -2
  51. data/lib/less/js/lib/less/tree/media.js +20 -4
  52. data/lib/less/js/lib/less/tree/mixin.js +38 -18
  53. data/lib/less/js/lib/less/tree/negative.js +22 -0
  54. data/lib/less/js/lib/less/tree/operation.js +32 -17
  55. data/lib/less/js/lib/less/tree/paren.js +5 -1
  56. data/lib/less/js/lib/less/tree/quoted.js +5 -3
  57. data/lib/less/js/lib/less/tree/rule.js +44 -31
  58. data/lib/less/js/lib/less/tree/ruleset.js +50 -23
  59. data/lib/less/js/lib/less/tree/selector.js +49 -39
  60. data/lib/less/js/lib/less/tree/unicode-descriptor.js +1 -0
  61. data/lib/less/js/lib/less/tree/url.js +9 -5
  62. data/lib/less/js/lib/less/tree/value.js +4 -1
  63. data/lib/less/js/lib/less/tree/variable.js +4 -3
  64. data/lib/less/js/lib/less/visitor.js +54 -0
  65. data/lib/less/js/package.json +69 -19
  66. data/lib/less/js/test/browser-test-prepare.js +23 -6
  67. data/lib/less/js/test/browser/common.js +55 -3
  68. data/lib/less/js/test/browser/css/urls.css +13 -0
  69. data/lib/less/js/test/browser/less/relative-urls/urls.less +1 -1
  70. data/lib/less/js/test/browser/less/urls.less +16 -0
  71. data/lib/less/js/test/browser/phantom-runner.js +7 -5
  72. data/lib/less/js/test/browser/runner-browser.js +5 -1
  73. data/lib/less/js/test/browser/runner-errors.js +5 -0
  74. data/lib/less/js/test/browser/runner-legacy.js +6 -0
  75. data/lib/less/js/test/browser/runner-production.js +7 -0
  76. data/lib/less/js/test/browser/template.htm +6 -6
  77. data/lib/less/js/test/css/comments.css +1 -0
  78. data/lib/less/js/test/css/compression/compression.css +2 -0
  79. data/lib/less/js/test/css/css-3.css +4 -0
  80. data/lib/less/js/test/css/css.css +9 -3
  81. data/lib/less/js/test/css/extend-chaining.css +72 -0
  82. data/lib/less/js/test/css/extend-clearfix.css +19 -0
  83. data/lib/less/js/test/css/extend-exact.css +37 -0
  84. data/lib/less/js/test/css/extend-media.css +24 -0
  85. data/lib/less/js/test/css/extend-nest.css +57 -0
  86. data/lib/less/js/test/css/extend-selector.css +72 -0
  87. data/lib/less/js/test/css/extend.css +76 -0
  88. data/lib/less/js/test/css/functions.css +28 -0
  89. data/lib/less/js/test/css/import-interpolation.css +6 -0
  90. data/lib/less/js/test/css/import.css +18 -1
  91. data/lib/less/js/test/css/legacy/legacy.css +7 -0
  92. data/lib/less/js/test/css/media.css +9 -1
  93. data/lib/less/js/test/css/mixins-args.css +18 -0
  94. data/lib/less/js/test/css/mixins-guards.css +5 -0
  95. data/lib/less/js/test/css/parens.css +18 -5
  96. data/lib/less/js/test/css/selectors.css +14 -6
  97. data/lib/less/js/test/css/urls.css +17 -0
  98. data/lib/less/js/test/css/variables.css +22 -3
  99. data/lib/less/js/test/data/data-uri-fail.png +0 -0
  100. data/lib/less/js/test/data/image.jpg +0 -0
  101. data/lib/less/js/test/data/page.html +1 -0
  102. data/lib/less/js/test/less-test.js +41 -9
  103. data/lib/less/js/test/less/colors.less +4 -4
  104. data/lib/less/js/test/less/comments.less +2 -2
  105. data/lib/less/js/test/less/compression/compression.less +16 -0
  106. data/lib/less/js/test/less/css-3.less +5 -1
  107. data/lib/less/js/test/less/css.less +9 -3
  108. data/lib/less/js/test/less/errors/add-mixed-units.less +3 -0
  109. data/lib/less/js/test/less/errors/add-mixed-units.txt +2 -0
  110. data/lib/less/js/test/less/errors/add-mixed-units2.less +3 -0
  111. data/lib/less/js/test/less/errors/add-mixed-units2.txt +2 -0
  112. data/lib/less/js/test/less/errors/bad-variable-declaration1.txt +1 -1
  113. data/lib/less/js/test/less/errors/color-operation-error.less +3 -0
  114. data/lib/less/js/test/less/errors/color-operation-error.txt +2 -0
  115. data/lib/less/js/test/less/errors/comment-in-selector.txt +1 -1
  116. data/lib/less/js/test/less/errors/divide-mixed-units.less +3 -0
  117. data/lib/less/js/test/less/errors/divide-mixed-units.txt +4 -0
  118. data/lib/less/js/test/less/errors/extend-no-selector.less +3 -0
  119. data/lib/less/js/test/less/errors/extend-no-selector.txt +3 -0
  120. data/lib/less/js/test/less/errors/extend-not-at-end.less +3 -0
  121. data/lib/less/js/test/less/errors/extend-not-at-end.txt +3 -0
  122. data/lib/less/js/test/less/errors/import-missing.less +5 -0
  123. data/lib/less/js/test/less/errors/import-missing.txt +3 -3
  124. data/lib/less/js/test/less/errors/import-no-semi.txt +1 -1
  125. data/lib/less/js/test/less/errors/import-subfolder1.txt +1 -1
  126. data/lib/less/js/test/less/errors/import-subfolder2.txt +1 -1
  127. data/lib/less/js/test/less/errors/javascript-error.txt +1 -1
  128. data/lib/less/js/test/less/errors/mixed-mixin-definition-args-1.txt +1 -1
  129. data/lib/less/js/test/less/errors/mixed-mixin-definition-args-2.txt +1 -1
  130. data/lib/less/js/test/less/errors/mixin-not-defined.txt +1 -1
  131. data/lib/less/js/test/less/errors/mixin-not-matched.txt +1 -1
  132. data/lib/less/js/test/less/errors/mixin-not-matched2.txt +1 -1
  133. data/lib/less/js/test/less/errors/multiply-mixed-units.less +7 -0
  134. data/lib/less/js/test/less/errors/multiply-mixed-units.txt +4 -0
  135. data/lib/less/js/test/less/errors/parens-error-1.less +3 -0
  136. data/lib/less/js/test/less/errors/parens-error-1.txt +4 -0
  137. data/lib/less/js/test/less/errors/parens-error-2.less +3 -0
  138. data/lib/less/js/test/less/errors/parens-error-2.txt +4 -0
  139. data/lib/less/js/test/less/errors/parens-error-3.less +3 -0
  140. data/lib/less/js/test/less/errors/parens-error-3.txt +4 -0
  141. data/lib/less/js/test/less/errors/parse-error-curly-bracket.txt +1 -1
  142. data/lib/less/js/test/less/errors/parse-error-missing-bracket.txt +2 -1
  143. data/lib/less/js/test/less/errors/parse-error-with-import.txt +1 -1
  144. data/lib/less/js/test/less/errors/property-ie5-hack.txt +1 -1
  145. data/lib/less/js/test/less/errors/property-in-root.less +4 -0
  146. data/lib/less/js/test/less/errors/property-in-root.txt +4 -0
  147. data/lib/less/js/test/less/errors/property-in-root2.less +1 -0
  148. data/lib/less/js/test/less/errors/property-in-root2.txt +4 -0
  149. data/lib/less/js/test/less/errors/property-in-root3.less +4 -0
  150. data/lib/less/js/test/less/errors/property-in-root3.txt +3 -0
  151. data/lib/less/js/test/less/errors/recursive-variable.txt +1 -1
  152. data/lib/less/js/test/less/extend-chaining.less +79 -0
  153. data/lib/less/js/test/less/extend-clearfix.less +19 -0
  154. data/lib/less/js/test/less/extend-exact.less +46 -0
  155. data/lib/less/js/test/less/extend-media.less +24 -0
  156. data/lib/less/js/test/less/extend-nest.less +65 -0
  157. data/lib/less/js/test/less/extend-selector.less +84 -0
  158. data/lib/less/js/test/less/extend.less +81 -0
  159. data/lib/less/js/test/less/functions.less +37 -6
  160. data/lib/less/js/test/less/import-interpolation.less +8 -0
  161. data/lib/less/js/test/less/import-once.less +4 -4
  162. data/lib/less/js/test/less/import.less +11 -2
  163. data/lib/less/js/test/less/import/deeper/import-once-test-a.less +1 -1
  164. data/lib/less/js/test/less/import/import-interpolation.less +1 -0
  165. data/lib/less/js/test/less/import/import-interpolation2.less +5 -0
  166. data/lib/less/js/test/less/javascript.less +1 -1
  167. data/lib/less/js/test/less/legacy/legacy.less +7 -0
  168. data/lib/less/js/test/less/media.less +14 -3
  169. data/lib/less/js/test/less/mixins-args.less +43 -5
  170. data/lib/less/js/test/less/mixins-guards.less +13 -0
  171. data/lib/less/js/test/less/mixins-named-args.less +5 -5
  172. data/lib/less/js/test/less/mixins-nested.less +2 -2
  173. data/lib/less/js/test/less/mixins-pattern.less +1 -1
  174. data/lib/less/js/test/less/mixins.less +1 -1
  175. data/lib/less/js/test/less/operations.less +27 -27
  176. data/lib/less/js/test/less/parens.less +20 -5
  177. data/lib/less/js/test/less/selectors.less +14 -7
  178. data/lib/less/js/test/less/urls.less +24 -0
  179. data/lib/less/js/test/less/variables.less +42 -12
  180. data/lib/less/loader.rb +33 -0
  181. data/lib/less/version.rb +1 -1
  182. data/spec/less/parser_spec.rb +5 -5
  183. metadata +76 -6
  184. data/lib/less/js/build/ecma-5.js +0 -120
  185. data/lib/less/js/lib/less/tree/ratio.js +0 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: edd0a37f217fc7f82ecacd61d005d98facb1bf3e
4
- data.tar.gz: 1e08a4d6576fc4bf9904bbedd6de899809544d41
3
+ metadata.gz: be1d8e73c0b849d27778ce76026be575faed01f7
4
+ data.tar.gz: b6b86514ad4e34352d46b24d0ac1ac94c3241568
5
5
  SHA512:
6
- metadata.gz: df2456cec8c5dcada02b52a8adaa528bd69d8a2efda863e75d253209dab593a1e57bf335fce2cca6fa5fdb0a897cb908cef9b6164ac4bd625512e6cd6c9b9e5e
7
- data.tar.gz: 67beb24ca0c5df4772d4747cf063b75c3a9909a4231d30af88fd384fcb9877cb3eb71b60e1b5d67d27bc1b90bb91d06d60f40e985b71a1d4dd63a49929951c3d
6
+ metadata.gz: 227be52a6ad06b7c44f24dc04700d101575bb4d2d59048635d5649ff94e9dd53b9be0075883bb60b063fefb9e6d8ba61c9ac771e704e3c9de78166ef50592333
7
+ data.tar.gz: 541fca5eecb7f998193867d513f728343c0a9f637a8ae79b69b4917646ec688b89c79216a234061599c4307ca50ffa521cc5390275006988e52054c7845392d6
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ ## 2.4.0 2013/09/02
4
+
5
+ * upgrade to less 1.4.2
@@ -22,5 +22,5 @@ Gem::Specification.new do |s|
22
22
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
23
23
  s.require_paths = ["lib"]
24
24
 
25
- s.add_dependency "commonjs", "~> 0.2.6"
25
+ s.add_dependency "commonjs", "~> 0.2.7"
26
26
  end
@@ -0,0 +1,9 @@
1
+ *.js text eol=lf
2
+ lessc text eol=lf
3
+ *.less text eol=lf
4
+ *.css text eol=lf
5
+ *.htm text eol=lf
6
+
7
+ *.jpg binary
8
+ *.png binary
9
+ *.jpeg binary
@@ -3,5 +3,6 @@ node_modules
3
3
  *.flymake
4
4
  *~
5
5
  .#*
6
+ .idea
6
7
  test/browser/less.js
7
8
  test/browser/test-runner-*.htm
@@ -1 +1 @@
1
- dist/*
1
+ .gitattributes
@@ -1,3 +1,71 @@
1
+ # 1.4.2
2
+
3
+ 2013-07-20
4
+
5
+ - if you don't pass a strict maths option, font size/line height options are output correctly again
6
+ - npmignore now include .gitattributes
7
+ - property names may include capital letters
8
+ - various windows path fixes (capital letters, multiple // in a path)
9
+
10
+ # 1.4.1
11
+
12
+ 2013-07-05
13
+
14
+ - fix syncImports and yui-compress option, as they were being ignored
15
+ - fixed several global variable leaks
16
+ - handle getting null or undefined passed as the options object
17
+
18
+ # 1.4.0
19
+
20
+ 2013-06-05
21
+
22
+ - fix passing of strict maths option
23
+
24
+ # 1.4.0 Beta 4
25
+
26
+ 2013-05-04
27
+
28
+ - change strictMaths to strictMath. Enable this with --strict-math=on in lessc and strictMath:true in JavaScript.
29
+ - change lessc option for strict units to --strict-units=off
30
+
31
+ # 1.4.0 Beta 3
32
+
33
+ 2013-04-30
34
+
35
+ - strictUnits now defaults to false and the true case now gives more useful but less correct results, e.g. 2px/1px = 2px
36
+ - Process ./ when having relative paths
37
+ - add isunit function for mixin guards and non basic units
38
+ - extends recognise attributes
39
+ - exception errors extend the JavaScript Error
40
+ - remove es-5-shim as standard from the browser
41
+ - Fix path issues with windows/linux local paths
42
+
43
+ # 1.4.0 Beta 1 & 2
44
+
45
+ 2013-03-07
46
+
47
+ - support for `:extend()` in selectors (e.g. `input:extend(.button) {}`) and `&:extend();` in ruleset (e.g. `input { &:extend(.button all); }`)
48
+ - maths is now only done inside brackets. This means font: statements, media queries and the calc function can use a simpler format without being escaped. Disable this with --strict-maths-off in lessc and strictMaths:false in JavaScript.
49
+ - units are calculated, e.g. 200cm+1m = 3m, 3px/1px = 3. If you use units inconsistently you will get an error. Suppress this error with --strict-units-off in lessc or strictUnits:false in JavaScript
50
+ - `(~"@var")` selector interpolation is removed. Use @{var} in selectors to have variable selectors
51
+ - default behaviour of import is to import each file once. `@import-once` has been removed.
52
+ - You can specify options on imports to force it to behave as css or less `@import (less) "file.css"` will process the file as less
53
+ - variables in mixins no longer 'leak' into their calling scope
54
+ - added data-uri function which will inline an image into the output css. If ieCompat option is true and file is too large, it will fallback to a url()
55
+ - significant bug fixes to our debug options
56
+ - other parameters can be used as defaults in mixins e.g. .a(@a, @b:@a)
57
+ - an error is shown if properties are used outside of a ruleset
58
+ - added extract function which picks a value out of a list, e.g. extract(12 13 14, 3) => 3
59
+ - added luma, hsvhue, hsvsaturation, hsvvalue functions
60
+ - added pow, pi, mod, tan, sin, cos, atan, asin, acos and sqrt math functions
61
+ - added convert function, e.g. convert(1rad, deg) => value in degrees
62
+ - lessc makes output directories if they don't exist
63
+ - lessc `@import` supports https and 301's
64
+ - lessc "-depends" option for lessc writes out the list of import files used in makefile format
65
+ - lessc "-lint" option just reports errors
66
+ - support for namespaces in attributes and selector interpolation in attributes
67
+ - other bug fixes
68
+
1
69
  # 1.3.3
2
70
 
3
71
  2012-12-30
@@ -1,50 +1,49 @@
1
- ## Bug Reports
1
+ # Contributing to Less.js
2
2
 
3
- - Please create a short test case
4
- - Test with the latest version
5
- - indicate how you use less - browser/lessc/external tool
3
+ > We welcome feature requests and bug reports. Please read these guidelines before submitting one.
6
4
 
7
- ## Feature Requests
8
5
 
9
- - Please search feature requests to see if something similar exists already
10
- - include a use-case - we do not add language features without a reason
11
- - consider whether your language feature would be better as a function
6
+ <span class="warning">**Words that begin with the at sign (`@`) must be wrapped in backticks!** </span>. as a courtesy to avoid sending notifications to any user that might have the `@username` being referenced. Remember, usernames start with the at sign.
12
7
 
13
- ## Pull Requests
8
+ GitHub has other great markdown features as well, [go here to learn more about them](https://help.github.com/articles/github-flavored-markdown).
14
9
 
15
- Thankyou! Please take the time to read these guidelines
16
10
 
17
- - Consider adding a feature request first to see if people are pro or con
18
- - do not change the dist/ folder - we do this when releasing
19
- - tests - please add tests for your work. use `make test` to see if they pass
20
- - spaces not tabs
21
- - end lines in semi-colons - loosely aim towards jslint standards
11
+ ## Reporting Issues
22
12
 
23
- ## Developing
13
+ We only accept issues that are bug reports or feature requests. Bugs must be isolated and reproducible problems that we can fix within the Less.js core. Please read the following guidelines before opening any issue.
24
14
 
25
- 1. install cygwin - http://cygwin.com/install.html
26
- - default options +
27
- - Devel -> Make
28
- -> Git
29
- 2. install node.js - http://nodejs.org/
30
- 3. install phantomJS - http://phantomjs.org/download.html
31
- - copy to a directory of your choice
32
- - (windows) modify the path directory to include whereever you have copied it
33
- 4. clone the repository and download to local computer
34
- 5. run `npm install -g diff` to get diffs in your tests
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
+ 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
+ 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.
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.
35
20
 
36
- `lessc or node bin/lessc`
37
21
 
38
- to run the less compiler
22
+ ## Feature Requests
23
+
24
+ * Please search for existing feature requests first to see if something similar already exists.
25
+ * Include a clear and specific use-case. We love new ideas, but we do not add language features without a reason.
26
+ * Consider whether or not your language feature would be better as a function or implemented in a 3rd-party build system such as [assemble-less](http://github.com/assemble/assemble-less).
39
27
 
40
- `make test`
41
28
 
42
- runs the node tests
29
+ ## Pull Requests
43
30
 
44
- `make browser-test`
31
+ _Pull requests are encouraged!_
45
32
 
46
- runs the headless browser tests
33
+ * Start by adding a feature request to get feedback and see how your idea is received.
34
+ * If your pull request solves an existing issue, but it's different in some way, _please create a new issue_ and make sure to discuss it with the core contributors. Otherwise you risk your hard work being rejected.
35
+ * Do not change the **./dist/** folder, we do this when releasing
36
+ * _Please add tests_ for your work. Use `make test` to see if they pass node.js tests and `make browser-test` to see the browser ([PhantomJS](http://phantomjs.org/)) tests pass.
47
37
 
48
- `make browser-test-server`
49
38
 
50
- sets up the server for the headless tests.. then go to http://localhost:8081/browser/test-runner-main.htm or one of the other test runner pages created in /test/browser/
39
+ ### Coding Standards
40
+
41
+ * Always use spaces, never tabs
42
+ * End lines in semi-colons.
43
+ * Loosely aim towards jsHint standards
44
+
45
+
46
+ ## Developing
47
+ If you want to take an issue just add a small comment saying you are having a go at something, so we don't get duplication.
48
+
49
+ Learn more about [developing Less.js](https://github.com/less/less.js/wiki/Developing-less.js).
@@ -23,18 +23,28 @@ DIST_MIN = dist/less-${VERSION}.min.js
23
23
 
24
24
  browser-prepare: DIST := test/browser/less.js
25
25
 
26
+ alpha: DIST := dist/less-${VERSION}-alpha.js
27
+ alpha: DIST_MIN := dist/less-${VERSION}-alpha.min.js
28
+
29
+ beta: DIST := dist/less-${VERSION}-beta.js
30
+ beta: DIST_MIN := dist/less-${VERSION}-beta.min.js
31
+
26
32
  less:
27
33
  @@mkdir -p dist
28
34
  @@touch ${DIST}
29
35
  @@cat ${HEADER} | sed s/@VERSION/${VERSION}/ > ${DIST}
30
36
  @@echo "(function (window, undefined) {" >> ${DIST}
31
37
  @@cat build/require.js\
32
- build/ecma-5.js\
33
38
  ${SRC}/parser.js\
34
39
  ${SRC}/functions.js\
35
40
  ${SRC}/colors.js\
36
41
  ${SRC}/tree/*.js\
37
42
  ${SRC}/tree.js\
43
+ ${SRC}/env.js\
44
+ ${SRC}/visitor.js\
45
+ ${SRC}/import-visitor.js\
46
+ ${SRC}/join-selector-visitor.js\
47
+ ${SRC}/extend-visitor.js\
38
48
  ${SRC}/browser.js\
39
49
  build/amd.js >> ${DIST}
40
50
  @@echo "})(window);" >> ${DIST}
@@ -53,8 +63,12 @@ rhino:
53
63
  @@mkdir -p dist
54
64
  @@touch ${RHINO}
55
65
  @@cat build/require-rhino.js\
56
- build/ecma-5.js\
57
66
  ${SRC}/parser.js\
67
+ ${SRC}/env.js\
68
+ ${SRC}/visitor.js\
69
+ ${SRC}/import-visitor.js\
70
+ ${SRC}/join-selector-visitor.js\
71
+ ${SRC}/extend-visitor.js\
58
72
  ${SRC}/functions.js\
59
73
  ${SRC}/colors.js\
60
74
  ${SRC}/tree/*.js\
@@ -67,21 +81,22 @@ min: less
67
81
  @@uglifyjs ${DIST} > ${DIST_MIN}
68
82
  @@echo ${DIST_MIN} built.
69
83
 
70
- server: less
71
- cp dist/less-${VERSION}.js test/html/
72
- cd test/html && python -m SimpleHTTPServer
84
+ alpha: min
85
+
86
+ beta: min
73
87
 
74
- clean:
75
- git rm dist/*
88
+ alpha-release: alpha
89
+ git add dist/*.js
90
+ git commit -m "Update alpha ${VERSION}"
76
91
 
77
- dist: clean min
92
+ dist: min rhino
78
93
  git add dist/*
79
94
  git commit -a -m "(dist) build ${VERSION}"
80
95
  git archive master --prefix=less/ -o less-${VERSION}.tar.gz
81
96
  npm publish less-${VERSION}.tar.gz
82
97
 
83
98
  stable:
84
- npm tag less ${VERSION} stable
99
+ npm tag less@${VERSION} stable
85
100
 
86
101
 
87
102
  .PHONY: test benchmark
@@ -10,11 +10,11 @@ about
10
10
 
11
11
  This is the JavaScript, and now official, stable version of LESS.
12
12
 
13
- For more information, visit <http://lesscss.org>.
13
+ For more information on the language and usage visit [lesscss.org](http://lesscss.org). More information also available [in our wiki](https://github.com/less/less.js/wiki)
14
14
 
15
15
  license
16
16
  -------
17
17
 
18
18
  See `LICENSE` file.
19
19
 
20
- > Copyright (c) 2009-2011 Alexis Sellier
20
+ > Copyright (c) 2009-2013 Alexis Sellier & The Core Less Team
@@ -3,20 +3,28 @@
3
3
  var path = require('path'),
4
4
  fs = require('fs'),
5
5
  sys = require('util'),
6
- os = require('os');
6
+ os = require('os'),
7
+ mkdirp;
7
8
 
8
9
  var less = require('../lib/less');
9
10
  var args = process.argv.slice(1);
10
11
  var options = {
12
+ depends: false,
11
13
  compress: false,
12
14
  yuicompress: false,
15
+ max_line_len: -1,
13
16
  optimization: 1,
14
17
  silent: false,
18
+ verbose: false,
19
+ lint: false,
15
20
  paths: [],
16
21
  color: true,
17
22
  strictImports: false,
18
23
  rootpath: '',
19
- relativeUrls: false
24
+ relativeUrls: false,
25
+ ieCompat: true,
26
+ strictMath: false,
27
+ strictUnits: false
20
28
  };
21
29
  var continueProcessing = true,
22
30
  currentErrorcode;
@@ -25,6 +33,25 @@ var continueProcessing = true,
25
33
  // so use this to set the exit code
26
34
  process.on('exit', function() { process.reallyExit(currentErrorcode) });
27
35
 
36
+ var checkArgFunc = function(arg, option) {
37
+ if (!option) {
38
+ sys.puts(arg + " option requires a parameter");
39
+ continueProcessing = false;
40
+ return false;
41
+ }
42
+ return true;
43
+ };
44
+
45
+ var checkBooleanArg = function(arg) {
46
+ var onOff = /^((on|t|true|y|yes)|(off|f|false|n|no))$/i.exec(arg);
47
+ if (!onOff) {
48
+ sys.puts(" unable to parse "+arg+" as a boolean. use one of on/t/true/y/yes/off/f/false/n/no");
49
+ continueProcessing = false;
50
+ return false;
51
+ }
52
+ return Boolean(onOff[2]);
53
+ };
54
+
28
55
  args = args.filter(function (arg) {
29
56
  var match;
30
57
 
@@ -33,7 +60,7 @@ args = args.filter(function (arg) {
33
60
  return false;
34
61
  }
35
62
 
36
- if (match = arg.match(/^--?([a-z][0-9a-z-]*)(?:=([^\s]+))?$/i)) { arg = match[1] }
63
+ if (match = arg.match(/^--?([a-z][0-9a-z-]*)(?:=([^\s]*))?$/i)) { arg = match[1] }
37
64
  else { return arg }
38
65
 
39
66
  switch (arg) {
@@ -48,6 +75,10 @@ args = args.filter(function (arg) {
48
75
  case 'silent':
49
76
  options.silent = true;
50
77
  break;
78
+ case 'l':
79
+ case 'lint':
80
+ options.lint = true;
81
+ break;
51
82
  case 'strict-imports':
52
83
  options.strictImports = true;
53
84
  break;
@@ -59,17 +90,29 @@ args = args.filter(function (arg) {
59
90
  case 'compress':
60
91
  options.compress = true;
61
92
  break;
93
+ case 'M':
94
+ case 'depends':
95
+ options.depends = true;
96
+ break;
62
97
  case 'yui-compress':
63
98
  options.yuicompress = true;
64
99
  break;
100
+ case 'max-line-len':
101
+ if (checkArgFunc(arg, match[2])) {
102
+ options.maxLineLen = parseInt(match[2], 10);
103
+ if (options.maxLineLen <= 0) {
104
+ options.maxLineLen = -1;
105
+ }
106
+ }
107
+ break;
65
108
  case 'no-color':
66
109
  options.color = false;
67
110
  break;
111
+ case 'no-ie-compat':
112
+ options.ieCompat = false;
113
+ break;
68
114
  case 'include-path':
69
- if (!match[2]) {
70
- sys.puts("include-path option requires a parameter");
71
- continueProcessing = false;
72
- } else {
115
+ if (checkArgFunc(arg, match[2])) {
73
116
  options.paths = match[2].split(os.type().match(/Windows/) ? ';' : ':')
74
117
  .map(function(p) {
75
118
  if (p) {
@@ -82,21 +125,32 @@ args = args.filter(function (arg) {
82
125
  case 'O1': options.optimization = 1; break;
83
126
  case 'O2': options.optimization = 2; break;
84
127
  case 'line-numbers':
85
- options.dumpLineNumbers = match[2];
128
+ if (checkArgFunc(arg, match[2])) {
129
+ options.dumpLineNumbers = match[2];
130
+ }
86
131
  break;
87
132
  case 'rp':
88
133
  case 'rootpath':
89
- if (!match[2]) {
90
- sys.puts("rootpath option requires a parameter");
91
- continueProcessing = false;
92
- } else {
93
- options.rootpath = path.normalize(match[2] + '/').replace('\\', '/');
134
+ if (checkArgFunc(arg, match[2])) {
135
+ options.rootpath = match[2].replace(/\\/g, '/');
94
136
  }
95
137
  break;
96
138
  case "ru":
97
139
  case "relative-urls":
98
140
  options.relativeUrls = true;
99
141
  break;
142
+ case "sm":
143
+ case "strict-math":
144
+ if (checkArgFunc(arg, match[2])) {
145
+ options.strictMath = checkBooleanArg(match[2]);
146
+ }
147
+ break;
148
+ case "su":
149
+ case "strict-units":
150
+ if (checkArgFunc(arg, match[2])) {
151
+ options.strictUnits = checkBooleanArg(match[2]);
152
+ }
153
+ break;
100
154
  }
101
155
  });
102
156
 
@@ -105,10 +159,12 @@ if (!continueProcessing) {
105
159
  }
106
160
 
107
161
  var input = args[1];
162
+ var inputbase = args[1];
108
163
  if (input && input != '-') {
109
164
  input = path.resolve(process.cwd(), input);
110
165
  }
111
166
  var output = args[2];
167
+ var outputbase = args[2];
112
168
  if (output) {
113
169
  output = path.resolve(process.cwd(), output);
114
170
  }
@@ -123,12 +179,26 @@ if (! input) {
123
179
 
124
180
  var ensureDirectory = function (filepath) {
125
181
  var dir = path.dirname(filepath),
182
+ cmd,
126
183
  existsSync = fs.existsSync || path.existsSync;
127
184
  if (!existsSync(dir)) {
128
- fs.mkdirSync(dir);
185
+ if (mkdirp === undefined) {
186
+ try {mkdirp = require('mkdirp');}
187
+ catch(e) { mkdirp = null; }
188
+ }
189
+ cmd = mkdirp && mkdirp.sync || fs.mkdirSync;
190
+ cmd(dir);
129
191
  }
130
192
  };
131
193
 
194
+ if (options.depends) {
195
+ if (!outputbase) {
196
+ sys.print("option --depends requires an output path to be specified");
197
+ return;
198
+ }
199
+ sys.print(outputbase + ": ");
200
+ }
201
+
132
202
  var parseLessFile = function (e, data) {
133
203
  if (e) {
134
204
  sys.puts("lessc: " + e.message);
@@ -136,24 +206,31 @@ var parseLessFile = function (e, data) {
136
206
  return;
137
207
  }
138
208
 
139
- new(less.Parser)({
140
- paths: [path.dirname(input)].concat(options.paths),
141
- optimization: options.optimization,
142
- filename: input,
143
- rootpath: options.rootpath,
144
- relativeUrls: options.relativeUrls,
145
- strictImports: options.strictImports,
146
- dumpLineNumbers: options.dumpLineNumbers
147
- }).parse(data, function (err, tree) {
209
+ options.paths = [path.dirname(input)].concat(options.paths);
210
+ options.filename = input;
211
+
212
+ var parser = new(less.Parser)(options);
213
+ parser.parse(data, function (err, tree) {
148
214
  if (err) {
149
215
  less.writeError(err, options);
150
216
  currentErrorcode = 1;
151
217
  return;
152
- } else {
218
+ } else if (options.depends) {
219
+ for(var file in parser.imports.files) {
220
+ sys.print(file + " ")
221
+ }
222
+ sys.print("\n");
223
+ } else if(!options.lint) {
153
224
  try {
154
225
  var css = tree.toCSS({
226
+ silent: options.silent,
227
+ verbose: options.verbose,
228
+ ieCompat: options.ieCompat,
155
229
  compress: options.compress,
156
- yuicompress: options.yuicompress
230
+ yuicompress: options.yuicompress,
231
+ maxLineLen: options.maxLineLen,
232
+ strictMath: options.strictMath,
233
+ strictUnits: options.strictUnits
157
234
  });
158
235
  if (output) {
159
236
  ensureDirectory(output);