less 2.4.0 → 2.5.3

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 (405) hide show
  1. package/.idea/jsLibraryMappings.xml +7 -7
  2. package/.idea/less.js.iml +9 -16
  3. package/.idea/libraries/less_js_node_modules.xml +14 -0
  4. package/.idea/misc.xml +14 -5
  5. package/.idea/modules.xml +8 -9
  6. package/.idea/vcs.xml +6 -7
  7. package/.idea/workspace.xml +592 -806
  8. package/.jscsrc +72 -72
  9. package/.travis.yml +1 -0
  10. package/CHANGELOG.md +54 -8
  11. package/Gruntfile.js +40 -13
  12. package/README.md +2 -0
  13. package/appveyor.yml +0 -6
  14. package/bin/lessc +22 -24
  15. package/bower.json +1 -2
  16. package/dist/less-rolledup.js +8572 -0
  17. package/dist/less.js +807 -401
  18. package/dist/less.min.js +9 -8
  19. package/lib/less/contexts.js +2 -0
  20. package/lib/less/environment/abstract-file-manager.js +5 -1
  21. package/lib/less/functions/color.js +46 -12
  22. package/lib/less/functions/function-caller.js +31 -2
  23. package/lib/less/functions/function-registry.js +28 -17
  24. package/lib/less/functions/math-helper.js +16 -0
  25. package/lib/less/functions/math.js +4 -16
  26. package/lib/less/functions/number.js +7 -2
  27. package/lib/less/functions/string.js +5 -3
  28. package/lib/less/functions/svg.js +19 -11
  29. package/lib/less/functions/types.js +1 -6
  30. package/lib/less/import-manager.js +8 -3
  31. package/lib/less/index.js +1 -1
  32. package/lib/less/parser/parser-input.js +55 -54
  33. package/lib/less/parser/parser.js +168 -52
  34. package/lib/less/plugins/function-importer.js +35 -0
  35. package/lib/less/source-map-output.js +1 -2
  36. package/lib/less/tree/anonymous.js +10 -2
  37. package/lib/less/tree/color.js +4 -1
  38. package/lib/less/tree/comment.js +0 -3
  39. package/lib/less/tree/dimension.js +5 -3
  40. package/lib/less/tree/directive.js +40 -15
  41. package/lib/less/tree/expression.js +5 -0
  42. package/lib/less/tree/import.js +22 -10
  43. package/lib/less/tree/media.js +3 -23
  44. package/lib/less/tree/mixin-call.js +17 -7
  45. package/lib/less/tree/mixin-definition.js +20 -6
  46. package/lib/less/tree/rule.js +19 -1
  47. package/lib/less/tree/ruleset.js +40 -27
  48. package/lib/less/tree/selector.js +8 -1
  49. package/lib/less/visitors/extend-visitor.js +1 -4
  50. package/lib/less/visitors/import-visitor.js +17 -2
  51. package/lib/less/visitors/join-selector-visitor.js +6 -0
  52. package/lib/less/visitors/to-css-visitor.js +48 -14
  53. package/lib/less-browser/bootstrap.js +5 -6
  54. package/lib/less-browser/index.js +20 -12
  55. package/lib/less-node/image-size.js +54 -31
  56. package/lib/less-node/index.js +1 -1
  57. package/lib/less-node/lessc-helper.js +2 -2
  58. package/lib/less-rhino/index.js +12 -8
  59. package/package.json +9 -13
  60. package/test/browser/less/urls.less +7 -1
  61. package/test/browser/less.js +30 -0
  62. package/test/browser/runner-VisitorPlugin-options.js +3 -0
  63. package/test/browser/runner-VisitorPlugin.js +3 -0
  64. package/test/browser/runner-filemanagerPlugin-options.js +4 -0
  65. package/test/browser/runner-filemanagerPlugin.js +3 -0
  66. package/test/browser/runner-global-vars-options.js +2 -1
  67. package/test/browser/runner-main-options.js +11 -11
  68. package/test/browser/runner-postProcessor.js +1 -1
  69. package/test/browser/runner-postProcessorPlugin-options.js +3 -0
  70. package/test/browser/runner-postProcessorPlugin.js +3 -0
  71. package/test/browser/runner-preProcessorPlugin-options.js +3 -0
  72. package/test/browser/runner-preProcessorPlugin.js +3 -0
  73. package/test/css/comments2.css +1 -1
  74. package/test/css/compression/compression.css +1 -1
  75. package/test/css/detached-rulesets.css +5 -0
  76. package/test/css/directives-bubling.css +119 -0
  77. package/test/css/extract-and-length.css +1 -1
  78. package/test/css/filemanagerPlugin/filemanager.css +3 -0
  79. package/test/css/functions.css +17 -1
  80. package/test/css/import-reference.css +5 -1
  81. package/test/css/import.css +4 -0
  82. package/test/css/include-path/include-path.css +4 -1
  83. package/test/css/include-path-string/include-path-string.css +3 -0
  84. package/test/css/legacy/legacy.css +14 -0
  85. package/test/css/media.css +0 -1
  86. package/test/css/mixins-args.css +51 -1
  87. package/test/css/plugin.css +44 -0
  88. package/test/css/postProcessorPlugin/postProcessor.css +4 -0
  89. package/test/css/preProcessorPlugin/preProcessor.css +3 -0
  90. package/test/css/scope.css +1 -1
  91. package/test/css/strings.css +1 -1
  92. package/test/css/url-args/urls.css +5 -5
  93. package/test/css/urls.css +8 -8
  94. package/test/css/variables.css +5 -5
  95. package/test/css/visitorPlugin/visitor.css +3 -0
  96. package/test/data/image.jpg +0 -0
  97. package/test/data/image.svg +2 -1
  98. package/test/data/page.html +1 -1
  99. package/test/index.js +5 -0
  100. package/test/less/detached-rulesets.less +9 -0
  101. package/test/less/directives-bubling.less +142 -0
  102. package/test/less/errors/at-rules-undefined-var.txt +4 -4
  103. package/test/less/errors/css-guard-default-func.txt +4 -4
  104. package/test/less/errors/javascript-undefined-var.txt +4 -4
  105. package/test/less/errors/mixins-guards-default-func-1.txt +4 -4
  106. package/test/less/errors/mixins-guards-default-func-2.txt +4 -4
  107. package/test/less/errors/mixins-guards-default-func-3.txt +4 -4
  108. package/test/less/errors/{parse-error-extra-parens.less → parse-error-media-no-block-1.less} +0 -0
  109. package/test/less/errors/parse-error-media-no-block-1.txt +3 -0
  110. package/test/less/errors/parse-error-media-no-block-2.less +1 -0
  111. package/test/less/errors/parse-error-media-no-block-2.txt +2 -0
  112. package/test/less/errors/parse-error-media-no-block-3.less +4 -0
  113. package/test/less/errors/parse-error-media-no-block-3.txt +3 -0
  114. package/test/less/errors/percentage-non-number-argument.less +3 -0
  115. package/test/less/errors/percentage-non-number-argument.txt +4 -0
  116. package/test/less/errors/property-interp-not-defined.txt +2 -2
  117. package/test/less/errors/svg-gradient2.txt +1 -1
  118. package/test/less/errors/svg-gradient3.txt +1 -1
  119. package/test/less/errors/svg-gradient4.less +4 -0
  120. package/test/less/errors/svg-gradient4.txt +4 -0
  121. package/test/less/errors/svg-gradient5.less +4 -0
  122. package/test/less/errors/svg-gradient5.txt +4 -0
  123. package/test/less/errors/svg-gradient6.less +4 -0
  124. package/test/less/errors/svg-gradient6.txt +4 -0
  125. package/test/less/filemanagerPlugin/colors.test +1 -0
  126. package/test/less/filemanagerPlugin/filemanager.less +4 -0
  127. package/test/less/functions.less +20 -2
  128. package/test/less/import/css-import.less +1 -0
  129. package/test/less/import/import-inline-invalid-css.less +1 -0
  130. package/test/less/import/import-reference.less +10 -1
  131. package/test/less/import/import-test-a.less +1 -0
  132. package/test/less/import-reference.less +4 -1
  133. package/test/less/import.less +1 -0
  134. package/test/less/include-path/include-path.less +3 -1
  135. package/test/less/include-path-string/include-path-string.less +3 -0
  136. package/test/less/legacy/legacy.less +14 -0
  137. package/test/less/mixins-args.less +48 -0
  138. package/test/less/mixins-guards.less +9 -0
  139. package/test/less/no-output.less +1 -1
  140. package/test/less/plugin/plugin-global.js +9 -0
  141. package/test/less/plugin/plugin-local.js +8 -0
  142. package/test/less/plugin/plugin-transitive.js +5 -0
  143. package/test/less/plugin/plugin-transitive.less +5 -0
  144. package/test/less/plugin.less +85 -0
  145. package/test/less/postProcessorPlugin/postProcessor.less +4 -0
  146. package/test/less/preProcessorPlugin/preProcessor.less +3 -0
  147. package/test/less/sourcemaps/imported.css +6 -6
  148. package/test/less/visitorPlugin/visitor.less +4 -0
  149. package/test/less-bom/charsets.less +3 -0
  150. package/test/less-bom/colors.less +98 -0
  151. package/test/less-bom/comments.less +102 -0
  152. package/test/less-bom/comments2.less +20 -0
  153. package/test/less-bom/compression/compression.less +36 -0
  154. package/test/less-bom/css-3.less +154 -0
  155. package/test/less-bom/css-escapes.less +33 -0
  156. package/test/less-bom/css-guards.less +103 -0
  157. package/test/less-bom/css.less +108 -0
  158. package/test/less-bom/debug/import/test.less +25 -0
  159. package/test/less-bom/debug/linenumbers.less +33 -0
  160. package/test/less-bom/detached-rulesets.less +112 -0
  161. package/test/less-bom/directives-bubling.less +142 -0
  162. package/test/less-bom/empty.less +1 -0
  163. package/test/less-bom/errors/add-mixed-units.less +3 -0
  164. package/test/less-bom/errors/add-mixed-units.txt +4 -0
  165. package/test/less-bom/errors/add-mixed-units2.less +3 -0
  166. package/test/less-bom/errors/add-mixed-units2.txt +4 -0
  167. package/test/less-bom/errors/at-rules-undefined-var.less +4 -0
  168. package/test/less-bom/errors/at-rules-undefined-var.txt +4 -0
  169. package/test/less-bom/errors/bad-variable-declaration1.less +1 -0
  170. package/test/less-bom/errors/bad-variable-declaration1.txt +2 -0
  171. package/test/less-bom/errors/color-func-invalid-color.less +3 -0
  172. package/test/less-bom/errors/color-func-invalid-color.txt +4 -0
  173. package/test/less-bom/errors/color-invalid-hex-code.less +3 -0
  174. package/test/less-bom/errors/color-invalid-hex-code.txt +4 -0
  175. package/test/less-bom/errors/color-invalid-hex-code2.less +3 -0
  176. package/test/less-bom/errors/color-invalid-hex-code2.txt +4 -0
  177. package/test/less-bom/errors/css-guard-default-func.less +4 -0
  178. package/test/less-bom/errors/css-guard-default-func.txt +4 -0
  179. package/test/less-bom/errors/detached-ruleset-1.less +6 -0
  180. package/test/less-bom/errors/detached-ruleset-1.txt +4 -0
  181. package/test/less-bom/errors/detached-ruleset-2.less +6 -0
  182. package/test/less-bom/errors/detached-ruleset-2.txt +4 -0
  183. package/test/less-bom/errors/detached-ruleset-3.less +4 -0
  184. package/test/less-bom/errors/detached-ruleset-3.txt +4 -0
  185. package/test/less-bom/errors/detached-ruleset-5.less +4 -0
  186. package/test/less-bom/errors/detached-ruleset-5.txt +3 -0
  187. package/test/less-bom/errors/detached-ruleset-6.less +5 -0
  188. package/test/less-bom/errors/detached-ruleset-6.txt +4 -0
  189. package/test/less-bom/errors/divide-mixed-units.less +3 -0
  190. package/test/less-bom/errors/divide-mixed-units.txt +4 -0
  191. package/test/less-bom/errors/extend-no-selector.less +3 -0
  192. package/test/less-bom/errors/extend-no-selector.txt +3 -0
  193. package/test/less-bom/errors/extend-not-at-end.less +3 -0
  194. package/test/less-bom/errors/extend-not-at-end.txt +3 -0
  195. package/test/less-bom/errors/import-malformed.less +1 -0
  196. package/test/less-bom/errors/import-malformed.txt +3 -0
  197. package/test/less-bom/errors/import-missing.less +6 -0
  198. package/test/less-bom/errors/import-missing.txt +3 -0
  199. package/test/less-bom/errors/import-no-semi.less +1 -0
  200. package/test/less-bom/errors/import-no-semi.txt +2 -0
  201. package/test/less-bom/errors/import-subfolder1.less +1 -0
  202. package/test/less-bom/errors/import-subfolder1.txt +3 -0
  203. package/test/less-bom/errors/import-subfolder2.less +1 -0
  204. package/test/less-bom/errors/import-subfolder2.txt +4 -0
  205. package/test/less-bom/errors/imports/import-subfolder1.less +1 -0
  206. package/test/less-bom/errors/imports/import-subfolder2.less +1 -0
  207. package/test/less-bom/errors/imports/import-test.less +4 -0
  208. package/test/less-bom/errors/imports/subfolder/mixin-not-defined.less +1 -0
  209. package/test/less-bom/errors/imports/subfolder/parse-error-curly-bracket.less +1 -0
  210. package/test/less-bom/errors/javascript-error.less +3 -0
  211. package/test/less-bom/errors/javascript-error.txt +4 -0
  212. package/test/less-bom/errors/javascript-undefined-var.less +3 -0
  213. package/test/less-bom/errors/javascript-undefined-var.txt +4 -0
  214. package/test/less-bom/errors/mixed-mixin-definition-args-1.less +6 -0
  215. package/test/less-bom/errors/mixed-mixin-definition-args-1.txt +4 -0
  216. package/test/less-bom/errors/mixed-mixin-definition-args-2.less +6 -0
  217. package/test/less-bom/errors/mixed-mixin-definition-args-2.txt +4 -0
  218. package/test/less-bom/errors/mixin-not-defined.less +11 -0
  219. package/test/less-bom/errors/mixin-not-defined.txt +3 -0
  220. package/test/less-bom/errors/mixin-not-matched.less +6 -0
  221. package/test/less-bom/errors/mixin-not-matched.txt +3 -0
  222. package/test/less-bom/errors/mixin-not-matched2.less +6 -0
  223. package/test/less-bom/errors/mixin-not-matched2.txt +3 -0
  224. package/test/less-bom/errors/mixin-not-visible-in-scope-1.less +9 -0
  225. package/test/less-bom/errors/mixin-not-visible-in-scope-1.txt +4 -0
  226. package/test/less-bom/errors/mixins-guards-default-func-1.less +9 -0
  227. package/test/less-bom/errors/mixins-guards-default-func-1.txt +4 -0
  228. package/test/less-bom/errors/mixins-guards-default-func-2.less +9 -0
  229. package/test/less-bom/errors/mixins-guards-default-func-2.txt +4 -0
  230. package/test/less-bom/errors/mixins-guards-default-func-3.less +9 -0
  231. package/test/less-bom/errors/mixins-guards-default-func-3.txt +4 -0
  232. package/test/less-bom/errors/multiple-guards-on-css-selectors.less +4 -0
  233. package/test/less-bom/errors/multiple-guards-on-css-selectors.txt +4 -0
  234. package/test/less-bom/errors/multiple-guards-on-css-selectors2.less +4 -0
  235. package/test/less-bom/errors/multiple-guards-on-css-selectors2.txt +4 -0
  236. package/test/less-bom/errors/multiply-mixed-units.less +7 -0
  237. package/test/less-bom/errors/multiply-mixed-units.txt +4 -0
  238. package/test/less-bom/errors/parens-error-1.less +3 -0
  239. package/test/less-bom/errors/parens-error-1.txt +4 -0
  240. package/test/less-bom/errors/parens-error-2.less +3 -0
  241. package/test/less-bom/errors/parens-error-2.txt +4 -0
  242. package/test/less-bom/errors/parens-error-3.less +3 -0
  243. package/test/less-bom/errors/parens-error-3.txt +4 -0
  244. package/test/less-bom/errors/parse-error-curly-bracket.less +4 -0
  245. package/test/less-bom/errors/parse-error-curly-bracket.txt +4 -0
  246. package/test/less-bom/errors/parse-error-media-no-block-1.less +5 -0
  247. package/test/less-bom/errors/parse-error-media-no-block-1.txt +3 -0
  248. package/test/less-bom/errors/parse-error-media-no-block-2.less +1 -0
  249. package/test/less-bom/errors/parse-error-media-no-block-2.txt +2 -0
  250. package/test/less-bom/errors/parse-error-media-no-block-3.less +4 -0
  251. package/test/less-bom/errors/parse-error-media-no-block-3.txt +3 -0
  252. package/test/less-bom/errors/parse-error-missing-bracket.less +2 -0
  253. package/test/less-bom/errors/parse-error-missing-bracket.txt +3 -0
  254. package/test/less-bom/errors/parse-error-missing-parens.less +5 -0
  255. package/test/less-bom/errors/parse-error-missing-parens.txt +3 -0
  256. package/test/less-bom/errors/parse-error-with-import.less +13 -0
  257. package/test/less-bom/errors/parse-error-with-import.txt +4 -0
  258. package/test/less-bom/errors/percentage-missing-space.less +3 -0
  259. package/test/less-bom/errors/percentage-missing-space.txt +4 -0
  260. package/test/less-bom/errors/percentage-non-number-argument.less +3 -0
  261. package/test/less-bom/errors/percentage-non-number-argument.txt +4 -0
  262. package/test/less-bom/errors/property-asterisk-only-name.less +3 -0
  263. package/test/less-bom/errors/property-asterisk-only-name.txt +4 -0
  264. package/test/less-bom/errors/property-ie5-hack.less +3 -0
  265. package/test/less-bom/errors/property-ie5-hack.txt +3 -0
  266. package/test/less-bom/errors/property-in-root.less +4 -0
  267. package/test/less-bom/errors/property-in-root.txt +4 -0
  268. package/test/less-bom/errors/property-in-root2.less +1 -0
  269. package/test/less-bom/errors/property-in-root2.txt +4 -0
  270. package/test/less-bom/errors/property-in-root3.less +4 -0
  271. package/test/less-bom/errors/property-in-root3.txt +3 -0
  272. package/test/less-bom/errors/property-interp-not-defined.less +1 -0
  273. package/test/less-bom/errors/property-interp-not-defined.txt +2 -0
  274. package/test/less-bom/errors/recursive-variable.less +1 -0
  275. package/test/less-bom/errors/recursive-variable.txt +2 -0
  276. package/test/less-bom/errors/single-character.less +1 -0
  277. package/test/less-bom/errors/single-character.txt +2 -0
  278. package/test/less-bom/errors/svg-gradient1.less +3 -0
  279. package/test/less-bom/errors/svg-gradient1.txt +4 -0
  280. package/test/less-bom/errors/svg-gradient2.less +3 -0
  281. package/test/less-bom/errors/svg-gradient2.txt +4 -0
  282. package/test/less-bom/errors/svg-gradient3.less +3 -0
  283. package/test/less-bom/errors/svg-gradient3.txt +4 -0
  284. package/test/less-bom/errors/svg-gradient4.less +4 -0
  285. package/test/less-bom/errors/svg-gradient4.txt +4 -0
  286. package/test/less-bom/errors/svg-gradient5.less +4 -0
  287. package/test/less-bom/errors/svg-gradient5.txt +4 -0
  288. package/test/less-bom/errors/svg-gradient6.less +4 -0
  289. package/test/less-bom/errors/svg-gradient6.txt +4 -0
  290. package/test/less-bom/errors/unit-function.less +3 -0
  291. package/test/less-bom/errors/unit-function.txt +4 -0
  292. package/test/less-bom/extend-chaining.less +91 -0
  293. package/test/less-bom/extend-clearfix.less +19 -0
  294. package/test/less-bom/extend-exact.less +46 -0
  295. package/test/less-bom/extend-media.less +24 -0
  296. package/test/less-bom/extend-nest.less +65 -0
  297. package/test/less-bom/extend-selector.less +99 -0
  298. package/test/less-bom/extend.less +81 -0
  299. package/test/less-bom/extract-and-length.less +133 -0
  300. package/test/less-bom/filemanagerPlugin/colors.test +1 -0
  301. package/test/less-bom/filemanagerPlugin/filemanager.less +4 -0
  302. package/test/less-bom/functions.less +232 -0
  303. package/test/less-bom/globalVars/extended.json +5 -0
  304. package/test/less-bom/globalVars/extended.less +10 -0
  305. package/test/less-bom/globalVars/simple.json +3 -0
  306. package/test/less-bom/globalVars/simple.less +3 -0
  307. package/test/less-bom/ie-filters.less +15 -0
  308. package/test/less-bom/import/css-import.less +1 -0
  309. package/test/less-bom/import/deeper/deeper-2/url-import-2.less +3 -0
  310. package/test/less-bom/import/deeper/deeper-2/url-import.less +1 -0
  311. package/test/less-bom/import/deeper/import-once-test-a.less +1 -0
  312. package/test/less-bom/import/deeper/url-import.less +1 -0
  313. package/test/less-bom/import/import-and-relative-paths-test.less +17 -0
  314. package/test/less-bom/import/import-charset-test.less +1 -0
  315. package/test/less-bom/import/import-inline-invalid-css.less +1 -0
  316. package/test/less-bom/import/import-interpolation.less +2 -0
  317. package/test/less-bom/import/import-interpolation2.less +5 -0
  318. package/test/less-bom/import/import-once-test-c.less +6 -0
  319. package/test/less-bom/import/import-reference.less +98 -0
  320. package/test/less-bom/import/import-test-a.less +5 -0
  321. package/test/less-bom/import/import-test-b.less +8 -0
  322. package/test/less-bom/import/import-test-c.less +6 -0
  323. package/test/less-bom/import/import-test-d.css +1 -0
  324. package/test/less-bom/import/import-test-e.less +2 -0
  325. package/test/less-bom/import/import-test-f.less +5 -0
  326. package/test/less-bom/import/imports/font.less +8 -0
  327. package/test/less-bom/import/imports/logo.less +6 -0
  328. package/test/less-bom/import/interpolation-vars.less +6 -0
  329. package/test/less-bom/import/invalid-css.less +1 -0
  330. package/test/less-bom/import/urls.less +1 -0
  331. package/test/less-bom/import-inline.less +3 -0
  332. package/test/less-bom/import-interpolation.less +8 -0
  333. package/test/less-bom/import-once.less +6 -0
  334. package/test/less-bom/import-reference.less +26 -0
  335. package/test/less-bom/import.less +31 -0
  336. package/test/less-bom/include-path/include-path.less +8 -0
  337. package/test/less-bom/include-path-string/include-path-string.less +3 -0
  338. package/test/less-bom/javascript.less +38 -0
  339. package/test/less-bom/lazy-eval.less +6 -0
  340. package/test/less-bom/legacy/legacy.less +21 -0
  341. package/test/less-bom/media.less +234 -0
  342. package/test/less-bom/merge.less +78 -0
  343. package/test/less-bom/mixins-args.less +263 -0
  344. package/test/less-bom/mixins-closure.less +26 -0
  345. package/test/less-bom/mixins-guards-default-func.less +195 -0
  346. package/test/less-bom/mixins-guards.less +280 -0
  347. package/test/less-bom/mixins-important.less +53 -0
  348. package/test/less-bom/mixins-interpolated.less +75 -0
  349. package/test/less-bom/mixins-named-args.less +36 -0
  350. package/test/less-bom/mixins-nested.less +22 -0
  351. package/test/less-bom/mixins-pattern.less +102 -0
  352. package/test/less-bom/mixins.less +145 -0
  353. package/test/less-bom/modifyVars/extended.json +5 -0
  354. package/test/less-bom/modifyVars/extended.less +11 -0
  355. package/test/less-bom/nested-gradient-with-svg-gradient/mixin-consumer.less +5 -0
  356. package/test/less-bom/nested-gradient-with-svg-gradient/svg-gradient-mixin.less +15 -0
  357. package/test/less-bom/no-js-errors/no-js-errors.less +3 -0
  358. package/test/less-bom/no-js-errors/no-js-errors.txt +4 -0
  359. package/test/less-bom/no-output.less +2 -0
  360. package/test/less-bom/operations.less +62 -0
  361. package/test/less-bom/parens.less +45 -0
  362. package/test/less-bom/plugin/plugin-global.js +9 -0
  363. package/test/less-bom/plugin/plugin-local.js +8 -0
  364. package/test/less-bom/plugin/plugin-transitive.js +5 -0
  365. package/test/less-bom/plugin/plugin-transitive.less +5 -0
  366. package/test/less-bom/plugin.less +85 -0
  367. package/test/less-bom/postProcessorPlugin/postProcessor.less +4 -0
  368. package/test/less-bom/preProcessorPlugin/preProcessor.less +3 -0
  369. package/test/less-bom/property-name-interp.less +56 -0
  370. package/test/less-bom/rulesets.less +30 -0
  371. package/test/less-bom/scope.less +104 -0
  372. package/test/less-bom/selectors.less +184 -0
  373. package/test/less-bom/sourcemaps/basic.json +3 -0
  374. package/test/less-bom/sourcemaps/basic.less +27 -0
  375. package/test/less-bom/sourcemaps/imported.css +7 -0
  376. package/test/less-bom/sourcemaps-empty/empty.less +1 -0
  377. package/test/less-bom/sourcemaps-empty/var-defs.less +1 -0
  378. package/test/less-bom/static-urls/urls.less +33 -0
  379. package/test/less-bom/strict-units/strict-units.less +4 -0
  380. package/test/less-bom/strings.less +73 -0
  381. package/test/less-bom/url-args/urls.less +63 -0
  382. package/test/less-bom/urls.less +94 -0
  383. package/test/less-bom/variables-in-at-rules.less +20 -0
  384. package/test/less-bom/variables.less +119 -0
  385. package/test/less-bom/visitorPlugin/visitor.less +4 -0
  386. package/test/less-bom/whitespace.less +44 -0
  387. package/test/less-test.js +9 -5
  388. package/test/plugins/filemanager/index.js +19 -0
  389. package/test/plugins/postprocess/index.js +14 -0
  390. package/test/plugins/preprocess/index.js +19 -0
  391. package/test/plugins/visitor/index.js +24 -0
  392. package/test.less +1 -0
  393. package/.idea/codeStyleSettings.xml +0 -13
  394. package/.idea/encodings.xml +0 -5
  395. package/.idea/inspectionProfiles/Project_Default.xml +0 -8
  396. package/.idea/inspectionProfiles/profiles_settings.xml +0 -7
  397. package/.idea/jsLinters/jscs.xml +0 -4
  398. package/.idea/jsLinters/jshint.xml +0 -70
  399. package/.idea/libraries/sass_stdlib.xml +0 -8
  400. package/.idea/scopes/scope_settings.xml +0 -5
  401. package/projectFilesBackup/.idea/libraries/sass_stdlib.xml +0 -8
  402. package/test/less/errors/detached-ruleset-4.less +0 -5
  403. package/test/less/errors/detached-ruleset-4.txt +0 -4
  404. package/test/less/errors/parse-error-extra-parens.txt +0 -3
  405. package/test/sourcemaps/maps/import-map.map +0 -1
@@ -0,0 +1,234 @@
1
+ 
2
+ // For now, variables can't be declared inside @media blocks.
3
+
4
+ @var: 42;
5
+
6
+ @media print {
7
+ .class {
8
+ color: blue;
9
+ .sub {
10
+ width: @var;
11
+ }
12
+ }
13
+ .top, header > h1 {
14
+ color: (#222 * 2);
15
+ }
16
+ }
17
+
18
+ @media screen {
19
+ @base: 8;
20
+ body { max-width: (@base * 60); }
21
+ }
22
+
23
+ @ratio_large: 16;
24
+ @ratio_small: 9;
25
+
26
+ @media all and (device-aspect-ratio: @ratio_large / @ratio_small) {
27
+ body { max-width: 800px; }
28
+ }
29
+
30
+ @media all and (orientation:portrait) {
31
+ aside { float: none; }
32
+ }
33
+
34
+ @media handheld and (min-width: @var), screen and (min-width: 20em) {
35
+ body {
36
+ max-width: 480px;
37
+ }
38
+ }
39
+
40
+ body {
41
+ @media print {
42
+ padding: 20px;
43
+
44
+ header {
45
+ background-color: red;
46
+ }
47
+
48
+ @media (orientation:landscape) {
49
+ margin-left: 20px;
50
+ }
51
+ }
52
+ }
53
+
54
+ @media screen {
55
+ .sidebar {
56
+ width: 300px;
57
+ @media (orientation: landscape) {
58
+ width: 500px;
59
+ }
60
+ }
61
+ }
62
+
63
+ @media a {
64
+ .first {
65
+ @media b {
66
+ .second {
67
+ .third {
68
+ width: 300px;
69
+ @media c {
70
+ width: 500px;
71
+ }
72
+ }
73
+ .fourth {
74
+ width: 3;
75
+ }
76
+ }
77
+ }
78
+ }
79
+ }
80
+
81
+ body {
82
+ @media a, b and c {
83
+ width: 95%;
84
+
85
+ @media x, y {
86
+ width: 100%;
87
+ }
88
+ }
89
+ }
90
+
91
+ .mediaMixin(@fallback: 200px) {
92
+ background: black;
93
+
94
+ @media handheld {
95
+ background: white;
96
+
97
+ @media (max-width: @fallback) {
98
+ background: red;
99
+ }
100
+ }
101
+ }
102
+
103
+ .a {
104
+ .mediaMixin(100px);
105
+ }
106
+
107
+ .b {
108
+ .mediaMixin();
109
+ }
110
+ @smartphone: ~"only screen and (max-width: 200px)";
111
+ @media @smartphone {
112
+ body {
113
+ width: 480px;
114
+ }
115
+ }
116
+
117
+ @media print {
118
+ @page :left {
119
+ margin: 0.5cm;
120
+ }
121
+ @page :right {
122
+ margin: 0.5cm;
123
+ }
124
+ @page Test:first {
125
+ margin: 1cm;
126
+ }
127
+ @page :first {
128
+ size: 8.5in 11in;
129
+ @top-left {
130
+ margin: 1cm;
131
+ }
132
+ @top-left-corner {
133
+ margin: 1cm;
134
+ }
135
+ @top-center {
136
+ margin: 1cm;
137
+ }
138
+ @top-right {
139
+ margin: 1cm;
140
+ }
141
+ @top-right-corner {
142
+ margin: 1cm;
143
+ }
144
+ @bottom-left {
145
+ margin: 1cm;
146
+ }
147
+ @bottom-left-corner {
148
+ margin: 1cm;
149
+ }
150
+ @bottom-center {
151
+ margin: 1cm;
152
+ }
153
+ @bottom-right {
154
+ margin: 1cm;
155
+ }
156
+ @bottom-right-corner {
157
+ margin: 1cm;
158
+ }
159
+ @left-top {
160
+ margin: 1cm;
161
+ }
162
+ @left-middle {
163
+ margin: 1cm;
164
+ }
165
+ @left-bottom {
166
+ margin: 1cm;
167
+ }
168
+ @right-top {
169
+ margin: 1cm;
170
+ }
171
+ @right-middle {
172
+ content: "Page " counter(page);
173
+ }
174
+ @right-bottom {
175
+ margin: 1cm;
176
+ }
177
+ }
178
+ }
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) {
181
+ .b {
182
+ background: red;
183
+ }
184
+ }
185
+
186
+ .bg() {
187
+ background: red;
188
+
189
+ @media (max-width: 500px) {
190
+ background: green;
191
+ }
192
+ }
193
+
194
+ body {
195
+ .bg();
196
+ }
197
+
198
+ @bpMedium: 1000px;
199
+ @media (max-width: @bpMedium) {
200
+ body {
201
+ .bg();
202
+ background: blue;
203
+ }
204
+ }
205
+
206
+ @media (max-width: 1200px) {
207
+ /* a comment */
208
+
209
+ @media (max-width: 900px) {
210
+ body { font-size: 11px; }
211
+ }
212
+ }
213
+
214
+ .nav-justified {
215
+ @media (min-width: 480px) {
216
+ > li {
217
+ display: table-cell;
218
+ }
219
+ }
220
+ }
221
+
222
+ .menu
223
+ {
224
+ @media (min-width: 768px) {
225
+ .nav-justified();
226
+ }
227
+ }
228
+ @all: ~"all";
229
+ @tv: ~"tv";
230
+ @media @all and @tv {
231
+ .all-and-tv-variables {
232
+ var: all-and-tv;
233
+ }
234
+ }
@@ -0,0 +1,78 @@
1
+ .first-transform() {
2
+ transform+: rotate(90deg), skew(30deg);
3
+ }
4
+ .second-transform() {
5
+ transform+: scale(2,4);
6
+ }
7
+ .third-transform() {
8
+ transform: scaleX(45deg);
9
+ }
10
+ .fourth-transform() {
11
+ transform+: scaleX(45deg);
12
+ }
13
+ .fifth-transform() {
14
+ transform+: scale(2,4) !important;
15
+ }
16
+ .first-background() {
17
+ background+: url(data://img1.png);
18
+ }
19
+ .second-background() {
20
+ background+: url(data://img2.png);
21
+ }
22
+
23
+ .test1 {
24
+ // Can merge values
25
+ .first-transform();
26
+ .second-transform();
27
+ }
28
+ .test2 {
29
+ // Wont merge values without +: merge directive, for backwards compatibility with css
30
+ .first-transform();
31
+ .third-transform();
32
+ }
33
+ .test3 {
34
+ // Wont merge values from two sources with different properties
35
+ .fourth-transform();
36
+ .first-background();
37
+ }
38
+ .test4 {
39
+ // Wont merge values from sources that merked as !important, for backwards compatibility with css
40
+ .first-transform();
41
+ .fifth-transform();
42
+ }
43
+ .test5 {
44
+ // Wont merge values from mixins that merked as !important, for backwards compatibility with css
45
+ .first-transform();
46
+ .second-transform() !important;
47
+ }
48
+ .test6 {
49
+ // Ignores !merge if no peers found
50
+ .second-transform();
51
+ }
52
+
53
+ .test-interleaved {
54
+ transform+: t1;
55
+ background+: b1;
56
+ transform+: t2;
57
+ background+: b2, b3;
58
+ transform+: t3;
59
+ }
60
+
61
+ .test-spaced {
62
+ transform+_: t1;
63
+ background+_: b1;
64
+ transform+_: t2;
65
+ background+_: b2, b3;
66
+ transform+_: t3;
67
+ }
68
+
69
+ .test-interleaved-with-spaced {
70
+ transform+_: t1s;
71
+ transform+: t2;
72
+ background+: b1;
73
+ transform+_: t3s;
74
+ transform+: t4 t5s;
75
+ background+_: b2s, b3;
76
+ transform+_: t6s;
77
+ background+: b4;
78
+ }
@@ -0,0 +1,263 @@
1
+ .mixin (@a: 1px, @b: 50%) {
2
+ width: (@a * 5);
3
+ height: (@b - 1%);
4
+ }
5
+
6
+ .mixina (@style, @width, @color: black) {
7
+ border: @width @style @color;
8
+ }
9
+
10
+ .mixiny
11
+ (@a: 0, @b: 0) {
12
+ margin: @a;
13
+ padding: @b;
14
+ }
15
+
16
+ .hidden() {
17
+ color: transparent; // asd
18
+ }
19
+
20
+ #hidden {
21
+ .hidden;
22
+ }
23
+
24
+ #hidden1 {
25
+ .hidden();
26
+ }
27
+
28
+ .two-args {
29
+ color: blue;
30
+ .mixin(2px, 100%);
31
+ .mixina(dotted, 2px);
32
+ }
33
+
34
+ .one-arg {
35
+ .mixin(3px);
36
+ }
37
+
38
+ .no-parens {
39
+ .mixin;
40
+ }
41
+
42
+ .no-args {
43
+ .mixin();
44
+ }
45
+
46
+ .var-args {
47
+ @var: 9;
48
+ .mixin(@var, (@var * 2));
49
+ }
50
+
51
+ .multi-mix {
52
+ .mixin(2px, 30%);
53
+ .mixiny(4, 5);
54
+ }
55
+
56
+ .maxa(@arg1: 10, @arg2: #f00) {
57
+ padding: (@arg1 * 2px);
58
+ color: @arg2;
59
+ }
60
+
61
+ body {
62
+ .maxa(15);
63
+ }
64
+
65
+ @glob: 5;
66
+ .global-mixin(@a:2) {
67
+ width: (@glob + @a);
68
+ }
69
+
70
+ .scope-mix {
71
+ .global-mixin(3);
72
+ }
73
+
74
+ .nested-ruleset (@width: 200px) {
75
+ width: @width;
76
+ .column { margin: @width; }
77
+ }
78
+ .content {
79
+ .nested-ruleset(600px);
80
+ }
81
+
82
+ //
83
+
84
+ .same-var-name2(@radius) {
85
+ radius: @radius;
86
+ }
87
+ .same-var-name(@radius) {
88
+ .same-var-name2(@radius);
89
+ }
90
+ #same-var-name {
91
+ .same-var-name(5px);
92
+ }
93
+
94
+ //
95
+
96
+ .var-inside () {
97
+ @var: 10px;
98
+ width: @var;
99
+ }
100
+ #var-inside { .var-inside; }
101
+
102
+ .mixin-arguments (@width: 0px, ...) {
103
+ border: @arguments;
104
+ width: @width;
105
+ }
106
+
107
+ .arguments {
108
+ .mixin-arguments(1px, solid, black);
109
+ }
110
+ .arguments2 {
111
+ .mixin-arguments();
112
+ }
113
+ .arguments3 {
114
+ .mixin-arguments;
115
+ }
116
+
117
+ .mixin-arguments2 (@width, @rest...) {
118
+ border: @arguments;
119
+ rest: @rest;
120
+ width: @width;
121
+ }
122
+ .arguments4 {
123
+ .mixin-arguments2(0, 1, 2, 3, 4);
124
+ }
125
+
126
+ // Edge cases
127
+
128
+ .edge-case {
129
+ .mixin-arguments("{");
130
+ }
131
+
132
+ // Division vs. Literal Slash
133
+ .border-radius(@r: 2px/5px) {
134
+ border-radius: @r;
135
+ }
136
+ .slash-vs-math {
137
+ .border-radius();
138
+ .border-radius(5px/10px);
139
+ .border-radius((3px * 2));
140
+ }
141
+ // semi-colon vs comma for delimiting
142
+
143
+ .mixin-takes-one(@a) {
144
+ one: @a;
145
+ }
146
+
147
+ .mixin-takes-two(@a; @b) {
148
+ one: @a;
149
+ two: @b;
150
+ }
151
+
152
+ .comma-vs-semi-colon {
153
+ .mixin-takes-two(@a : a; @b : b, c);
154
+ .mixin-takes-two(@a : d, e; @b : f);
155
+ .mixin-takes-one(@a: g);
156
+ .mixin-takes-one(@a : h;);
157
+ .mixin-takes-one(i);
158
+ .mixin-takes-one(j;);
159
+ .mixin-takes-two(k, l);
160
+ .mixin-takes-one(m, n;);
161
+ .mixin-takes-two(o, p; q);
162
+ .mixin-takes-two(r, s; t;);
163
+ }
164
+
165
+ .mixin-conflict(@a:defA, @b:defB, @c:defC) {
166
+ three: @a, @b, @c;
167
+ }
168
+
169
+ .mixin-conflict(@a:defA, @b:defB, @c:defC, @d:defD) {
170
+ four: @a, @b, @c, @d;
171
+ }
172
+
173
+ #named-conflict {
174
+ .mixin-conflict(11, 12, 13, @a:a);
175
+ .mixin-conflict(@a:a, 21, 22, 23);
176
+ }
177
+ @a: 3px;
178
+ .mixin-default-arg(@a: 1px, @b: @a, @c: @b) {
179
+ defaults: 1px 1px 1px;
180
+ defaults: 2px 2px 2px;
181
+ }
182
+
183
+ .test-mixin-default-arg {
184
+ .mixin-default-arg();
185
+ .mixin-default-arg(2px);
186
+ }
187
+
188
+ .mixin-comma-default1(@color; @padding; @margin: 2, 2, 2, 2) {
189
+ margin: @margin;
190
+ }
191
+ .selector {
192
+ .mixin-comma-default1(#33acfe; 4);
193
+ }
194
+ .mixin-comma-default2(@margin: 2, 2, 2, 2;) {
195
+ margin: @margin;
196
+ }
197
+ .selector2 {
198
+ .mixin-comma-default2();
199
+ }
200
+ .mixin-comma-default3(@margin: 2, 2, 2, 2) {
201
+ margin: @margin;
202
+ }
203
+ .selector3 {
204
+ .mixin-comma-default3(4,2,2,2);
205
+ }
206
+
207
+ .test-calling-one-arg-mixin(@a) {
208
+ }
209
+
210
+ .test-calling-one-arg-mixin(@a, @b, @rest...) {
211
+ }
212
+
213
+ div {
214
+ .test-calling-one-arg-mixin(1);
215
+ }
216
+
217
+ mixins-args-expand-op- {
218
+ @x: 1, 2, 3;
219
+ @y: 4 5 6;
220
+
221
+ &1 {.m3(@x...)}
222
+ &2 {.m3(@y...)}
223
+ &3 {.wr(a, b, c)}
224
+ &4 {.wr(a; b; c, d)}
225
+ &5 {.wr(@x...)}
226
+ &6 {.m4(0; @x...)}
227
+ &7 {.m4(@x..., @a: 0)}
228
+ &8 {.m4(@b: 1.5; @x...)}
229
+ &9 {.aa(@y, @x..., and again, @y...)}
230
+
231
+ .m3(@a, @b, @c) {
232
+ m3: @a, @b, @c;
233
+ }
234
+
235
+ .m4(@a, @b, @c, @d) {
236
+ m4: @a, @b, @c, @d;
237
+ }
238
+
239
+ .wr(@a...) {
240
+ &a {.m3(@a...)}
241
+ &b {.m4(0, @a...)}
242
+ &c {.m4(@a..., 4)}
243
+ }
244
+
245
+ .aa(@a...) {
246
+ aa: @a;
247
+ a4: extract(@a, 5);
248
+ a8: extract(@a, 8);
249
+ }
250
+ }
251
+ #test-mixin-matching-when-default-2645 {
252
+ .mixin(@height) {
253
+ height: @height;
254
+ }
255
+
256
+ .mixin(@width, @height: 10px) {
257
+ width: @width;
258
+
259
+ .mixin(@height: @height);
260
+ }
261
+
262
+ .mixin(@height: 20px);
263
+ }
@@ -0,0 +1,26 @@
1
+ .scope {
2
+ @var: 99px;
3
+ .mixin () {
4
+ width: @var;
5
+ }
6
+ }
7
+
8
+ .class {
9
+ .scope > .mixin;
10
+ }
11
+
12
+ .overwrite {
13
+ @var: 0px;
14
+ .scope > .mixin;
15
+ }
16
+
17
+ .nested {
18
+ @var: 5px;
19
+ .mixin () {
20
+ width: @var;
21
+ }
22
+ .class {
23
+ @var: 10px;
24
+ .mixin;
25
+ }
26
+ }