less 2.4.0 → 2.5.0

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 (265) hide show
  1. checksums.yaml +4 -4
  2. data/Changelog.md +4 -0
  3. data/Gemfile +1 -1
  4. data/less.gemspec +1 -1
  5. data/lib/less/defaults.rb +3 -3
  6. data/lib/less/java_script/v8_context.rb +1 -1
  7. data/lib/less/js/.gitattributes +3 -2
  8. data/lib/less/js/.gitignore +18 -2
  9. data/lib/less/js/.jshintrc +11 -0
  10. data/lib/less/js/CHANGELOG.md +87 -2
  11. data/lib/less/js/CONTRIBUTING.md +4 -3
  12. data/lib/less/js/Gruntfile.js +290 -0
  13. data/lib/less/js/README.md +342 -12
  14. data/lib/less/js/benchmark/benchmark.less +194 -194
  15. data/lib/less/js/benchmark/less-benchmark.js +9 -10
  16. data/lib/less/js/bin/lessc +154 -12
  17. data/lib/less/js/bower.json +18 -0
  18. data/lib/less/js/build.gradle +347 -0
  19. data/lib/less/js/build/README.md +350 -0
  20. data/lib/less/js/build/browser-header.js +4 -0
  21. data/lib/less/js/build/build.yml +160 -0
  22. data/lib/less/js/build/require-rhino.js +7 -2
  23. data/lib/less/js/build/rhino-header.js +4 -0
  24. data/lib/less/js/build/rhino-modules.js +131 -0
  25. data/lib/less/js/build/tasks/.gitkeep +1 -0
  26. data/lib/less/js/dist/less-1.5.0.js +6914 -0
  27. data/lib/less/js/dist/less-1.5.0.min.js +13 -0
  28. data/lib/less/js/dist/less-1.5.1.js +6941 -0
  29. data/lib/less/js/dist/less-1.5.1.min.js +13 -0
  30. data/lib/less/js/dist/less-1.6.0.js +7485 -0
  31. data/lib/less/js/dist/less-1.6.0.min.js +16 -0
  32. data/lib/less/js/dist/less-1.6.1.js +7513 -0
  33. data/lib/less/js/dist/less-1.6.1.min.js +16 -0
  34. data/lib/less/js/dist/less-1.6.2.js +7624 -0
  35. data/lib/less/js/dist/less-1.6.2.min.js +16 -0
  36. data/lib/less/js/dist/less-rhino-1.5.1.js +6831 -0
  37. data/lib/less/js/dist/less-rhino-1.6.2.js +9017 -0
  38. data/lib/less/js/dist/lessc-rhino-1.6.2.js +449 -0
  39. data/lib/less/js/gradle/wrapper/gradle-wrapper.jar +0 -0
  40. data/lib/less/js/gradle/wrapper/gradle-wrapper.properties +6 -0
  41. data/lib/less/js/gradlew +164 -0
  42. data/lib/less/js/gradlew.bat +90 -0
  43. data/lib/less/js/lib/less/browser.js +482 -367
  44. data/lib/less/js/lib/less/colors.js +0 -1
  45. data/lib/less/js/lib/less/encoder.js +4 -0
  46. data/lib/less/js/lib/less/env.js +50 -19
  47. data/lib/less/js/lib/less/extend-visitor.js +66 -41
  48. data/lib/less/js/lib/less/functions.js +309 -104
  49. data/lib/less/js/lib/less/import-visitor.js +21 -10
  50. data/lib/less/js/lib/less/index.js +90 -68
  51. data/lib/less/js/lib/less/join-selector-visitor.js +11 -4
  52. data/lib/less/js/lib/less/lessc_helper.js +56 -45
  53. data/lib/less/js/lib/less/parser.js +830 -460
  54. data/lib/less/js/lib/less/rhino.js +380 -58
  55. data/lib/less/js/lib/less/source-map-output.js +141 -0
  56. data/lib/less/js/lib/less/to-css-visitor.js +215 -0
  57. data/lib/less/js/lib/less/tree.js +57 -5
  58. data/lib/less/js/lib/less/tree/alpha.js +13 -5
  59. data/lib/less/js/lib/less/tree/anonymous.js +11 -5
  60. data/lib/less/js/lib/less/tree/assignment.js +11 -5
  61. data/lib/less/js/lib/less/tree/call.js +19 -8
  62. data/lib/less/js/lib/less/tree/color.js +59 -36
  63. data/lib/less/js/lib/less/tree/comment.js +17 -4
  64. data/lib/less/js/lib/less/tree/condition.js +3 -3
  65. data/lib/less/js/lib/less/tree/dimension.js +161 -153
  66. data/lib/less/js/lib/less/tree/directive.js +39 -18
  67. data/lib/less/js/lib/less/tree/element.js +41 -18
  68. data/lib/less/js/lib/less/tree/expression.js +11 -5
  69. data/lib/less/js/lib/less/tree/extend.js +11 -1
  70. data/lib/less/js/lib/less/tree/import.js +34 -20
  71. data/lib/less/js/lib/less/tree/javascript.js +16 -10
  72. data/lib/less/js/lib/less/tree/keyword.js +5 -2
  73. data/lib/less/js/lib/less/tree/media.js +39 -22
  74. data/lib/less/js/lib/less/tree/mixin.js +135 -56
  75. data/lib/less/js/lib/less/tree/negative.js +4 -2
  76. data/lib/less/js/lib/less/tree/operation.js +17 -12
  77. data/lib/less/js/lib/less/tree/paren.js +5 -2
  78. data/lib/less/js/lib/less/tree/quoted.js +9 -6
  79. data/lib/less/js/lib/less/tree/rule.js +39 -21
  80. data/lib/less/js/lib/less/tree/ruleset.js +229 -145
  81. data/lib/less/js/lib/less/tree/selector.js +101 -34
  82. data/lib/less/js/lib/less/tree/unicode-descriptor.js +4 -3
  83. data/lib/less/js/lib/less/tree/url.js +33 -11
  84. data/lib/less/js/lib/less/tree/value.js +13 -6
  85. data/lib/less/js/lib/less/tree/variable.js +13 -8
  86. data/lib/less/js/lib/less/visitor.js +117 -25
  87. data/lib/less/js/lib/source-map/source-map-0.1.31.js +1933 -0
  88. data/lib/less/js/lib/source-map/source-map-footer.js +4 -0
  89. data/lib/less/js/lib/source-map/source-map-header.js +3 -0
  90. data/lib/less/js/package.json +30 -15
  91. data/lib/less/js/test/browser/common.js +131 -56
  92. data/lib/less/js/test/browser/css/global-vars/simple.css +3 -0
  93. data/lib/less/js/test/browser/css/modify-vars/simple.css +8 -0
  94. data/lib/less/js/test/browser/css/relative-urls/urls.css +8 -9
  95. data/lib/less/js/test/browser/css/rootpath-relative/urls.css +0 -1
  96. data/lib/less/js/test/browser/css/rootpath/urls.css +0 -1
  97. data/lib/less/js/test/browser/css/urls.css +18 -14
  98. data/lib/less/js/test/browser/es5.js +27 -0
  99. data/lib/less/js/test/{less/errors/color-operation-error.less → browser/less/console-errors/test-error.less} +0 -0
  100. data/lib/less/js/test/browser/less/console-errors/test-error.txt +2 -0
  101. data/lib/less/js/test/browser/less/global-vars/simple.less +3 -0
  102. data/lib/less/js/test/browser/less/modify-vars/imports/simple2.less +4 -0
  103. data/lib/less/js/test/browser/less/modify-vars/simple.less +8 -0
  104. data/lib/less/js/test/browser/less/relative-urls/urls.less +1 -1
  105. data/lib/less/js/test/browser/less/rootpath-relative/urls.less +1 -1
  106. data/lib/less/js/test/browser/less/rootpath/urls.less +1 -1
  107. data/lib/less/js/test/browser/less/urls.less +9 -1
  108. data/lib/less/js/test/browser/phantom-runner.js +112 -103
  109. data/lib/less/js/test/browser/runner-browser-options.js +42 -0
  110. data/lib/less/js/test/browser/{runner-browser.js → runner-browser-spec.js} +7 -2
  111. data/lib/less/js/test/browser/runner-console-errors.js +5 -0
  112. data/lib/less/js/test/browser/runner-errors-options.js +5 -0
  113. data/lib/less/js/test/browser/runner-errors-spec.js +4 -0
  114. data/lib/less/js/test/browser/runner-global-vars-options.js +4 -0
  115. data/lib/less/js/test/browser/runner-global-vars-spec.js +3 -0
  116. data/lib/less/js/test/browser/runner-legacy-options.js +4 -0
  117. data/lib/less/js/test/browser/{runner-legacy.js → runner-legacy-spec.js} +1 -4
  118. data/lib/less/js/test/browser/runner-main-options.js +15 -0
  119. data/lib/less/js/test/browser/runner-main-spec.js +3 -0
  120. data/lib/less/js/test/browser/runner-modify-vars-options.js +2 -0
  121. data/lib/less/js/test/browser/runner-modify-vars-spec.js +43 -0
  122. data/lib/less/js/test/browser/runner-no-js-errors-options.js +4 -0
  123. data/lib/less/js/test/browser/runner-no-js-errors-spec.js +4 -0
  124. data/lib/less/js/test/browser/runner-production-options.js +3 -0
  125. data/lib/less/js/test/browser/{runner-production.js → runner-production-spec.js} +1 -3
  126. data/lib/less/js/test/browser/runner-relative-urls-options.js +3 -0
  127. data/lib/less/js/test/browser/{runner-relative-urls.js → runner-relative-urls-spec.js} +1 -2
  128. data/lib/less/js/test/browser/runner-rootpath-options.js +3 -0
  129. data/lib/less/js/test/browser/runner-rootpath-relative-options.js +4 -0
  130. data/lib/less/js/test/browser/{runner-rootpath-relative.js → runner-rootpath-relative-spec.js} +1 -3
  131. data/lib/less/js/test/browser/{runner-rootpath.js → runner-rootpath-spec.js} +1 -2
  132. data/lib/less/js/test/browser/test-runner-template.tmpl +47 -0
  133. data/lib/less/js/test/css/colors.css +7 -0
  134. data/lib/less/js/test/css/comments.css +9 -4
  135. data/lib/less/js/test/css/compression/compression.css +3 -2
  136. data/lib/less/js/test/css/css-3.css +17 -5
  137. data/lib/less/js/test/css/css-guards.css +37 -0
  138. data/lib/less/js/test/css/debug/linenumbers-all.css +6 -0
  139. data/lib/less/js/test/css/debug/linenumbers-comments.css +5 -0
  140. data/lib/less/js/test/css/debug/linenumbers-mediaquery.css +5 -0
  141. data/lib/less/js/test/css/empty.css +0 -0
  142. data/lib/less/js/test/css/extend-chaining.css +9 -0
  143. data/lib/less/js/test/css/extend-selector.css +10 -2
  144. data/lib/less/js/test/css/extract-and-length.css +133 -0
  145. data/lib/less/js/test/css/functions.css +23 -10
  146. data/lib/less/js/test/css/globalVars/extended.css +12 -0
  147. data/lib/less/js/test/css/globalVars/simple.css +6 -0
  148. data/lib/less/js/test/css/import-inline.css +5 -0
  149. data/lib/less/js/test/css/import-once.css +12 -0
  150. data/lib/less/js/test/css/import-reference.css +49 -0
  151. data/lib/less/js/test/css/import.css +0 -2
  152. data/lib/less/js/test/css/media.css +21 -5
  153. data/lib/less/js/test/css/merge.css +26 -0
  154. data/lib/less/js/test/css/mixins-guards-default-func.css +129 -0
  155. data/lib/less/js/test/css/mixins-guards.css +6 -0
  156. data/lib/less/js/test/css/mixins-important.css +7 -0
  157. data/lib/less/js/test/css/mixins-interpolated.css +39 -0
  158. data/lib/less/js/test/css/mixins.css +20 -0
  159. data/lib/less/js/test/css/modifyVars/extended.css +9 -0
  160. data/lib/less/js/test/css/no-output.css +0 -0
  161. data/lib/less/js/test/css/parens.css +3 -0
  162. data/lib/less/js/test/css/property-name-interp.css +20 -0
  163. data/lib/less/js/test/css/selectors.css +12 -0
  164. data/lib/less/js/test/css/static-urls/urls.css +7 -4
  165. data/lib/less/js/test/css/strings.css +3 -0
  166. data/lib/less/js/test/css/url-args/urls.css +56 -0
  167. data/lib/less/js/test/css/urls.css +21 -9
  168. data/lib/less/js/test/index.js +45 -0
  169. data/lib/less/js/test/less-test.js +234 -191
  170. data/lib/less/js/test/less/colors.less +6 -0
  171. data/lib/less/js/test/less/comments.less +7 -1
  172. data/lib/less/js/test/less/compression/compression.less +21 -1
  173. data/lib/less/js/test/less/css-3.less +12 -0
  174. data/lib/less/js/test/less/css-guards.less +99 -0
  175. data/lib/less/js/test/less/debug/linenumbers.less +11 -1
  176. data/lib/less/js/test/less/empty.less +0 -0
  177. data/lib/less/js/test/less/errors/add-mixed-units.txt +4 -2
  178. data/lib/less/js/test/less/errors/add-mixed-units2.txt +4 -2
  179. data/lib/less/js/test/less/errors/color-func-invalid-color.less +3 -0
  180. data/lib/less/js/test/less/errors/color-func-invalid-color.txt +4 -0
  181. data/lib/less/js/test/less/errors/css-guard-default-func.less +4 -0
  182. data/lib/less/js/test/less/errors/css-guard-default-func.txt +4 -0
  183. data/lib/less/js/test/less/errors/import-subfolder2.txt +4 -2
  184. data/lib/less/js/test/less/errors/javascript-undefined-var.less +3 -0
  185. data/lib/less/js/test/less/errors/javascript-undefined-var.txt +4 -0
  186. data/lib/less/js/test/less/errors/mixins-guards-default-func-1.less +9 -0
  187. data/lib/less/js/test/less/errors/mixins-guards-default-func-1.txt +4 -0
  188. data/lib/less/js/test/less/errors/mixins-guards-default-func-2.less +9 -0
  189. data/lib/less/js/test/less/errors/mixins-guards-default-func-2.txt +4 -0
  190. data/lib/less/js/test/less/errors/mixins-guards-default-func-3.less +9 -0
  191. data/lib/less/js/test/less/errors/mixins-guards-default-func-3.txt +4 -0
  192. data/lib/less/js/test/less/errors/multiple-guards-on-css-selectors.less +4 -0
  193. data/lib/less/js/test/less/errors/multiple-guards-on-css-selectors.txt +4 -0
  194. data/lib/less/js/test/less/errors/multiple-guards-on-css-selectors2.less +4 -0
  195. data/lib/less/js/test/less/errors/multiple-guards-on-css-selectors2.txt +4 -0
  196. data/lib/less/js/test/less/errors/parse-error-curly-bracket.less +4 -1
  197. data/lib/less/js/test/less/errors/parse-error-curly-bracket.txt +4 -2
  198. data/lib/less/js/test/less/errors/parse-error-extra-parens.less +5 -0
  199. data/lib/less/js/test/less/errors/parse-error-extra-parens.txt +3 -0
  200. data/lib/less/js/test/less/errors/parse-error-missing-bracket.txt +2 -2
  201. data/lib/less/js/test/less/errors/parse-error-missing-parens.less +5 -0
  202. data/lib/less/js/test/less/errors/parse-error-missing-parens.txt +3 -0
  203. data/lib/less/js/test/less/errors/property-asterisk-only-name.less +3 -0
  204. data/lib/less/js/test/less/errors/property-asterisk-only-name.txt +4 -0
  205. data/lib/less/js/test/less/errors/property-interp-not-defined.less +1 -0
  206. data/lib/less/js/test/less/errors/property-interp-not-defined.txt +2 -0
  207. data/lib/less/js/test/less/errors/svg-gradient1.less +3 -0
  208. data/lib/less/js/test/less/errors/svg-gradient1.txt +4 -0
  209. data/lib/less/js/test/less/errors/svg-gradient2.less +3 -0
  210. data/lib/less/js/test/less/errors/svg-gradient2.txt +4 -0
  211. data/lib/less/js/test/less/errors/svg-gradient3.less +3 -0
  212. data/lib/less/js/test/less/errors/svg-gradient3.txt +4 -0
  213. data/lib/less/js/test/less/errors/unit-function.less +3 -0
  214. data/lib/less/js/test/less/errors/unit-function.txt +4 -0
  215. data/lib/less/js/test/less/extend-chaining.less +12 -0
  216. data/lib/less/js/test/less/extend-selector.less +15 -0
  217. data/lib/less/js/test/less/extract-and-length.less +133 -0
  218. data/lib/less/js/test/less/functions.less +15 -2
  219. data/lib/less/js/test/less/globalVars/extended.json +5 -0
  220. data/lib/less/js/test/less/globalVars/extended.less +10 -0
  221. data/lib/less/js/test/less/globalVars/simple.json +3 -0
  222. data/lib/less/js/test/less/globalVars/simple.less +3 -0
  223. data/lib/less/js/test/less/import-inline.less +2 -0
  224. data/lib/less/js/test/less/import-once.less +2 -0
  225. data/lib/less/js/test/less/import-reference.less +18 -0
  226. data/lib/less/js/test/less/import/import-and-relative-paths-test.less +11 -0
  227. data/lib/less/js/test/less/import/import-reference.less +43 -0
  228. data/lib/less/js/test/less/import/import-test-f.less +5 -0
  229. data/lib/less/js/test/less/import/invalid-css.less +1 -0
  230. data/lib/less/js/test/less/media.less +25 -1
  231. data/lib/less/js/test/less/merge.less +59 -0
  232. data/lib/less/js/test/less/mixins-args.less +10 -0
  233. data/lib/less/js/test/less/mixins-guards-default-func.less +195 -0
  234. data/lib/less/js/test/less/mixins-guards.less +16 -0
  235. data/lib/less/js/test/less/mixins-important.less +4 -1
  236. data/lib/less/js/test/less/mixins-interpolated.less +69 -0
  237. data/lib/less/js/test/less/mixins.less +27 -0
  238. data/lib/less/js/test/less/modifyVars/extended.json +5 -0
  239. data/lib/less/js/test/less/modifyVars/extended.less +11 -0
  240. data/lib/less/js/test/less/no-js-errors/no-js-errors.less +3 -0
  241. data/lib/less/js/test/less/no-js-errors/no-js-errors.txt +4 -0
  242. data/lib/less/js/test/less/no-output.less +2 -0
  243. data/lib/less/js/test/less/parens.less +4 -0
  244. data/lib/less/js/test/less/property-name-interp.less +53 -0
  245. data/lib/less/js/test/less/selectors.less +13 -0
  246. data/lib/less/js/test/less/sourcemaps/basic.json +3 -0
  247. data/lib/less/js/test/less/sourcemaps/basic.less +27 -0
  248. data/lib/less/js/test/less/sourcemaps/imported.css +7 -0
  249. data/lib/less/js/test/less/strings.less +6 -0
  250. data/lib/less/js/test/less/url-args/urls.less +63 -0
  251. data/lib/less/js/test/less/urls.less +15 -0
  252. data/lib/less/js/test/rhino/test-header.js +15 -0
  253. data/lib/less/js/test/sourcemaps/basic.json +1 -0
  254. data/lib/less/js/test/sourcemaps/index.html +17 -0
  255. data/lib/less/loader.rb +48 -40
  256. data/lib/less/version.rb +1 -1
  257. data/spec/less/parser_spec.rb +15 -15
  258. metadata +146 -40
  259. data/lib/less/js/Makefile +0 -102
  260. data/lib/less/js/build/header.js +0 -9
  261. data/lib/less/js/test/browser-test-prepare.js +0 -46
  262. data/lib/less/js/test/browser/runner-errors.js +0 -5
  263. data/lib/less/js/test/browser/runner-main.js +0 -15
  264. data/lib/less/js/test/browser/template.htm +0 -10
  265. data/lib/less/js/test/less/errors/color-operation-error.txt +0 -2
@@ -37,6 +37,7 @@
37
37
  .b { color: (#eee + #fff); } // #ffffff
38
38
  .c { color: (#aaa * 3); } // #ffffff
39
39
  .d { color: (#00ee00 + #009900); } // #00ff00
40
+ .e { color: rgba(-99.9, 31.4159, 321, 0.42); }
40
41
  }
41
42
 
42
43
  #grey {
@@ -90,3 +91,8 @@
90
91
  opacity: alpha(hsl(120, 100%, 50%));
91
92
  }
92
93
  }
94
+
95
+ #percentage {
96
+ color: red(rgb(100%, 0, 0));
97
+ border-color: rgba(100%, 0, 0, 50%);
98
+ }
@@ -34,7 +34,13 @@
34
34
 
35
35
  /* @group Variables
36
36
  ------------------- */
37
- #comments /* boo */ {
37
+ #comments /* boo *//* boo again*/,
38
+ //.commented_out1
39
+ //.commented_out2
40
+ //.commented_out3
41
+ .comments //end of comments1
42
+ //end of comments2
43
+ {
38
44
  /**/ // An empty comment
39
45
  color: red; /* A C-style comment */ /* A C-style comment */
40
46
  background-color: orange; // A little comment
@@ -4,6 +4,11 @@
4
4
  color3: rgba(255, 238, 170, 0.1);
5
5
  @color1: #fea;
6
6
  string: "@{color1}";
7
+ /* comments are stripped */
8
+ // both types!
9
+ /*! but not this type
10
+ Note preserved whitespace
11
+ */
7
12
  }
8
13
  dimensions {
9
14
  val: 0.1px;
@@ -12,5 +17,20 @@ dimensions {
12
17
  val: 0.2;
13
18
  val: 5;
14
19
  angles-must-have-unit: 0deg;
20
+ durations-must-have-unit: 0s;
21
+ length-doesnt-have-unit: 0px;
15
22
  width: auto\9;
16
- }
23
+ }
24
+ @page {
25
+ marks: none;
26
+ @top-left-corner {
27
+ vertical-align: top;
28
+ }
29
+ @top-left {
30
+ vertical-align: top;
31
+ }
32
+ }
33
+ .shadow ^ .dom,
34
+ body ^^ .shadow {
35
+ display: done;
36
+ }
@@ -114,4 +114,16 @@ foo|* { color: yellow; }
114
114
  h1 { color: green; }
115
115
  .upper-test {
116
116
  UpperCaseProperties: allowed;
117
+ }
118
+ @host {
119
+ div {
120
+ display: block;
121
+ }
122
+ }
123
+ ::distributed(input::placeholder) {
124
+ color: #b3b3b3;
125
+ }
126
+ .shadow ^ .dom,
127
+ body ^^ .shadow {
128
+ display: done;
117
129
  }
@@ -0,0 +1,99 @@
1
+
2
+ .light when (lightness(@a) > 50%) {
3
+ color: green;
4
+ }
5
+ .dark when (lightness(@a) < 50%) {
6
+ color: orange;
7
+ }
8
+ @a: #ddd;
9
+
10
+ .see-the {
11
+ @a: #444; // this mirrors what mixins do - they evaluate the guards at the point of definition
12
+ .light();
13
+ .dark();
14
+ }
15
+
16
+ .hide-the {
17
+ .light();
18
+ .dark();
19
+ }
20
+
21
+ .multiple-conditions-1 when (@b = 1), (@c = 2), (@d = 3) {
22
+ color: red;
23
+ }
24
+
25
+ .multiple-conditions-2 when (@b = 1), (@c = 2), (@d = 2) {
26
+ color: blue;
27
+ }
28
+
29
+ @b: 2;
30
+ @c: 3;
31
+ @d: 3;
32
+
33
+ .inheritance when (@b = 2) {
34
+ .test {
35
+ color: black;
36
+ }
37
+ &:hover {
38
+ color: pink;
39
+ }
40
+ .hideme when (@b = 1) {
41
+ color: green;
42
+ }
43
+ & when (@b = 1) {
44
+ hideme: green;
45
+ }
46
+ }
47
+
48
+ .hideme when (@b = 1) {
49
+ .test {
50
+ color: black;
51
+ }
52
+ &:hover {
53
+ color: pink;
54
+ }
55
+ .hideme when (@b = 1) {
56
+ color: green;
57
+ }
58
+ }
59
+
60
+ & when (@b = 1) {
61
+ .hideme {
62
+ color: red;
63
+ }
64
+ }
65
+
66
+ .mixin-with-guard-inside(@colWidth) {
67
+ // selector with guard (applies also to & when() ...)
68
+ .clsWithGuard when (@colWidth <= 0) {
69
+ dispaly: none;
70
+ }
71
+ }
72
+
73
+ .mixin-with-guard-inside(0px);
74
+
75
+ .dont-split-me-up {
76
+ width: 1px;
77
+ & when (@c = 3) {
78
+ color: red;
79
+ }
80
+ & when (@c = 3) {
81
+ height: 1px;
82
+ }
83
+ + & when (@c = 3) { // creates invalid css but tests that we don't fold it in
84
+ sibling: true;
85
+ }
86
+ }
87
+
88
+ .scope-check when (@c = 3) {
89
+ @k: 1px;
90
+ & when (@c = 3) {
91
+ @k: 2px;
92
+ sub-prop: @k;
93
+ }
94
+ prop: @k;
95
+ }
96
+ .scope-check-2 {
97
+ .scope-check();
98
+ @k:4px;
99
+ }
@@ -20,4 +20,14 @@
20
20
 
21
21
  .mixin_import1();
22
22
 
23
- .mixin_import2();
23
+ .mixin_import2();
24
+
25
+ @debug: 1;
26
+ & when (@debug = 1) {
27
+ .test {
28
+ color: red;
29
+ & when (@debug = 1) {
30
+ width: 2;
31
+ }
32
+ }
33
+ }
File without changes
@@ -1,2 +1,4 @@
1
- SyntaxError: Incompatible units. Change the units or use the unit function. Bad units: 'px' and 'em'. in {path}add-mixed-units.less on line null, column 0:
2
- 1 error: (1px + 3em);
1
+ SyntaxError: Incompatible units. Change the units or use the unit function. Bad units: 'px' and 'em'. in {path}add-mixed-units.less on line 2, column 3:
2
+ 1 .a {
3
+ 2 error: (1px + 3em);
4
+ 3 }
@@ -1,2 +1,4 @@
1
- SyntaxError: Incompatible units. Change the units or use the unit function. Bad units: 'px*px' and 'em*px'. in {path}add-mixed-units2.less on line null, column 0:
2
- 1 error: ((1px * 2px) + (3em * 3px));
1
+ SyntaxError: Incompatible units. Change the units or use the unit function. Bad units: 'px*px' and 'em*px'. in {path}add-mixed-units2.less on line 2, column 3:
2
+ 1 .a {
3
+ 2 error: ((1px * 2px) + (3em * 3px));
4
+ 3 }
@@ -0,0 +1,3 @@
1
+ .test {
2
+ color: color("NOT A COLOR");
3
+ }
@@ -0,0 +1,4 @@
1
+ ArgumentError: error evaluating function `color`: argument must be a color keyword or 3/6 digit hex e.g. #FFF in {path}color-func-invalid-color.less on line 2, column 10:
2
+ 1 .test {
3
+ 2 color: color("NOT A COLOR");
4
+ 3 }
@@ -0,0 +1,4 @@
1
+
2
+ selector when (default()) {
3
+ color: red;
4
+ }
@@ -0,0 +1,4 @@
1
+ SyntaxError: error evaluating function `default`: it is currently only allowed in parametric mixin guards, in {path}css-guard-default-func.less on line 2, column 16:
2
+ 1
3
+ 2 selector when (default()) {
4
+ 3 color: red;
@@ -1,2 +1,4 @@
1
- ParseError: missing opening `{` in {path}parse-error-curly-bracket.less on line 1, column 2:
2
- 1 }}
1
+ ParseError: missing opening `{` in {path}parse-error-curly-bracket.less on line 4, column 1:
2
+ 3 }
3
+ 4 }
4
+ 5
@@ -0,0 +1,3 @@
1
+ .scope {
2
+ @a: `@{b}`;
3
+ }
@@ -0,0 +1,4 @@
1
+ NameError: variable @b is undefined in {path}javascript-undefined-var.less on line 2, column 15:
2
+ 1 .scope {
3
+ 2 @a: `@{b}`;
4
+ 3 }
@@ -0,0 +1,9 @@
1
+
2
+ guard-default-func-conflict {
3
+ .m(@x, 1) {}
4
+ .m(@x, 2) when (default()) {}
5
+ .m(@x, 2) when (default()) {}
6
+
7
+ .m(1, 1);
8
+ .m(1, 2);
9
+ }
@@ -0,0 +1,4 @@
1
+ RuntimeError: Ambiguous use of `default()` found when matching for `.m(1, 2)` in {path}mixins-guards-default-func-1.less on line 8, column 5:
2
+ 7 .m(1, 1);
3
+ 8 .m(1, 2);
4
+ 9 }
@@ -0,0 +1,9 @@
1
+
2
+ guard-default-func-conflict {
3
+ .m(1) {}
4
+ .m(@x) when not(default()) {}
5
+ .m(@x) when (@x = 3) and (default()) {}
6
+
7
+ .m(2);
8
+ .m(3);
9
+ }
@@ -0,0 +1,4 @@
1
+ RuntimeError: Ambiguous use of `default()` found when matching for `.m(3)` in {path}mixins-guards-default-func-2.less on line 8, column 5:
2
+ 7 .m(2);
3
+ 8 .m(3);
4
+ 9 }
@@ -0,0 +1,9 @@
1
+
2
+ guard-default-func-conflict {
3
+ .m(1) {}
4
+ .m(@x) when not(default()) {}
5
+ .m(@x) when not(default()) {}
6
+
7
+ .m(1);
8
+ .m(2);
9
+ }
@@ -0,0 +1,4 @@
1
+ RuntimeError: Ambiguous use of `default()` found when matching for `.m(2)` in {path}mixins-guards-default-func-3.less on line 8, column 5:
2
+ 7 .m(1);
3
+ 8 .m(2);
4
+ 9 }
@@ -0,0 +1,4 @@
1
+ @ie8: true;
2
+ .a when (@ie8 = true),
3
+ .b {
4
+ }
@@ -0,0 +1,4 @@
1
+ SyntaxError: Guards are only currently allowed on a single selector. in {path}multiple-guards-on-css-selectors.less on line 3, column 1:
2
+ 2 .a when (@ie8 = true),
3
+ 3 .b {
4
+ 4 }
@@ -0,0 +1,4 @@
1
+ @ie8: true;
2
+ .a,
3
+ .b when (@ie8 = true) {
4
+ }
@@ -0,0 +1,4 @@
1
+ SyntaxError: Guards are only currently allowed on a single selector. in {path}multiple-guards-on-css-selectors2.less on line 3, column 23:
2
+ 2 .a,
3
+ 3 .b when (@ie8 = true) {
4
+ 4 }
@@ -1 +1,4 @@
1
- }}
1
+ body {
2
+ background-color: #fff;
3
+ }
4
+ }
@@ -1,2 +1,4 @@
1
- ParseError: missing opening `{` in {path}parse-error-curly-bracket.less on line 1, column 2:
2
- 1 }}
1
+ ParseError: missing opening `{` in {path}parse-error-curly-bracket.less on line 4, column 1:
2
+ 3 }
3
+ 4 }
4
+ 5
@@ -0,0 +1,5 @@
1
+ @media (extra: bracket)) {
2
+ body {
3
+ background-color: #fff;
4
+ }
5
+ }
@@ -0,0 +1,3 @@
1
+ ParseError: missing opening `(` in {path}parse-error-extra-parens.less on line 1, column 24:
2
+ 1 @media (extra: bracket)) {
3
+ 2 body {
@@ -1,3 +1,3 @@
1
- ParseError: missing closing `}` in {path}parse-error-missing-bracket.less on line 3, column 1:
1
+ ParseError: missing closing `}` in {path}parse-error-missing-bracket.less on line 1, column 6:
2
+ 1 body {
2
3
  2 background-color: #fff;
3
- 3
@@ -0,0 +1,5 @@
1
+ @media (missing: bracket {
2
+ body {
3
+ background-color: #fff;
4
+ }
5
+ }
@@ -0,0 +1,3 @@
1
+ ParseError: missing closing `)` in {path}parse-error-missing-parens.less on line 1, column 8:
2
+ 1 @media (missing: bracket {
3
+ 2 body {
@@ -0,0 +1,4 @@
1
+ ParseError: Unrecognised input in {path}property-asterisk-only-name.less on line 2, column 5:
2
+ 1 a {
3
+ 2 * : 1;
4
+ 3 }
@@ -0,0 +1 @@
1
+ a {outline-@{color}: green}
@@ -0,0 +1,2 @@
1
+ NameError: variable @color is undefined in {path}property-interp-not-defined.less on line 1, column 12:
2
+ 1 a {outline-@{color}: green}
@@ -0,0 +1,3 @@
1
+ .a {
2
+ a: svg-gradient(horizontal, black, white);
3
+ }
@@ -0,0 +1,4 @@
1
+ ArgumentError: error evaluating function `svg-gradient`: svg-gradient direction must be 'to bottom', 'to right', 'to bottom right', 'to top right' or 'ellipse at center' in {path}svg-gradient1.less on line 2, column 6:
2
+ 1 .a {
3
+ 2 a: svg-gradient(horizontal, black, white);
4
+ 3 }
@@ -0,0 +1,3 @@
1
+ .a {
2
+ a: svg-gradient(to bottom, black, orange, 45%, white);
3
+ }
@@ -0,0 +1,4 @@
1
+ ArgumentError: error evaluating function `svg-gradient`: svg-gradient expects direction, start_color [start_position], [color position,]..., end_color [end_position] in {path}svg-gradient2.less on line 2, column 6:
2
+ 1 .a {
3
+ 2 a: svg-gradient(to bottom, black, orange, 45%, white);
4
+ 3 }
@@ -0,0 +1,3 @@
1
+ .a {
2
+ a: svg-gradient(black, orange);
3
+ }
@@ -0,0 +1,4 @@
1
+ ArgumentError: error evaluating function `svg-gradient`: svg-gradient expects direction, start_color [start_position], [color position,]..., end_color [end_position] in {path}svg-gradient3.less on line 2, column 6:
2
+ 1 .a {
3
+ 2 a: svg-gradient(black, orange);
4
+ 3 }
@@ -0,0 +1,3 @@
1
+ .a {
2
+ font-size: unit(80/16,rem);
3
+ }
@@ -0,0 +1,4 @@
1
+ ArgumentError: error evaluating function `unit`: the first argument to unit must be a number. Have you forgotten parenthesis? in {path}unit-function.less on line 2, column 14:
2
+ 1 .a {
3
+ 2 font-size: unit(80/16,rem);
4
+ 3 }
@@ -59,6 +59,18 @@
59
59
  color: z;
60
60
  }
61
61
 
62
+ //very simple chaining, but with the extend inside the ruleset
63
+ .va {
64
+ color: black;
65
+ }
66
+ .vb {
67
+ &:extend(.va);
68
+ color: white;
69
+ }
70
+ .vc {
71
+ &:extend(.vb);
72
+ }
73
+
62
74
  // media queries - dont extend outside, do extend inside
63
75
 
64
76
  @media tv {