less 2.1.1 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (333) hide show
  1. package/.idea/inspectionProfiles/Project_Default.xml +1 -0
  2. package/.idea/jsLinters/jscs.xml +4 -0
  3. package/.idea/jsLinters/jshint.xml +58 -4
  4. package/.idea/workspace.xml +451 -758
  5. package/.jscsrc +38 -0
  6. package/.jshintrc +0 -2
  7. package/.travis.yml +0 -1
  8. package/CHANGELOG.md +52 -0
  9. package/Gruntfile.js +37 -3
  10. package/bin/lessc +380 -316
  11. package/bower.json +1 -1
  12. package/dist/less.js +790 -479
  13. package/dist/less.min.js +7 -7
  14. package/lib/less/contexts.js +1 -1
  15. package/lib/less/data/unit-conversions.js +3 -3
  16. package/lib/less/environment/abstract-file-manager.js +4 -4
  17. package/lib/less/environment/environment.js +9 -0
  18. package/lib/less/functions/color-blending.js +3 -3
  19. package/lib/less/functions/color.js +8 -8
  20. package/lib/less/functions/data-uri.js +39 -31
  21. package/lib/less/functions/string.js +3 -1
  22. package/lib/less/functions/svg.js +12 -15
  23. package/lib/less/functions/types.js +15 -2
  24. package/lib/less/import-manager.js +10 -5
  25. package/lib/less/index.js +2 -1
  26. package/lib/less/parse-tree.js +8 -2
  27. package/lib/less/parse.js +65 -0
  28. package/lib/less/parser/parser-input.js +3 -2
  29. package/lib/less/parser/parser.js +24 -11
  30. package/lib/less/render.js +7 -36
  31. package/lib/less/source-map-output.js +3 -3
  32. package/lib/less/transform-tree.js +1 -1
  33. package/lib/less/tree/assignment.js +0 -1
  34. package/lib/less/tree/color.js +4 -4
  35. package/lib/less/tree/condition.js +1 -1
  36. package/lib/less/tree/debug-info.js +6 -2
  37. package/lib/less/tree/dimension.js +1 -1
  38. package/lib/less/tree/directive.js +25 -6
  39. package/lib/less/tree/expression.js +1 -1
  40. package/lib/less/tree/import.js +2 -2
  41. package/lib/less/tree/index.js +1 -0
  42. package/lib/less/tree/media.js +3 -2
  43. package/lib/less/tree/mixin-call.js +3 -4
  44. package/lib/less/tree/mixin-definition.js +4 -3
  45. package/lib/less/tree/quoted.js +1 -1
  46. package/lib/less/tree/rule.js +2 -3
  47. package/lib/less/tree/ruleset.js +263 -157
  48. package/lib/less/tree/selector.js +2 -1
  49. package/lib/less/tree/url.js +5 -2
  50. package/lib/less/tree/value.js +1 -1
  51. package/lib/less/tree/variable.js +1 -1
  52. package/lib/less/visitors/extend-visitor.js +60 -25
  53. package/lib/less/visitors/import-sequencer.js +20 -14
  54. package/lib/less/visitors/import-visitor.js +13 -10
  55. package/lib/less/visitors/to-css-visitor.js +37 -5
  56. package/lib/less-browser/add-default-options.js +5 -1
  57. package/lib/less-browser/bootstrap.js +10 -8
  58. package/lib/less-browser/cache.js +1 -1
  59. package/lib/less-browser/index.js +13 -12
  60. package/lib/less-browser/utils.js +9 -6
  61. package/lib/less-node/file-manager.js +51 -28
  62. package/lib/less-node/image-size.js +34 -0
  63. package/lib/less-node/index.js +3 -0
  64. package/lib/less-node/lessc-helper.js +3 -2
  65. package/lib/less-node/url-file-manager.js +2 -2
  66. package/lib/less-rhino/index.js +2 -4
  67. package/package.json +10 -7
  68. package/test/browser/common.js +13 -11
  69. package/test/browser/css/urls.css +6 -3
  70. package/test/browser/jasmine-jsreporter.js +2 -3
  71. package/test/browser/less/nested-gradient-with-svg-gradient/mixin-consumer.less +5 -0
  72. package/test/browser/less/nested-gradient-with-svg-gradient/svg-gradient-mixin.less +15 -0
  73. package/test/browser/less/urls.less +1 -0
  74. package/test/browser/less.js +15 -9424
  75. package/test/browser/runner-errors-options.js +0 -1
  76. package/test/browser/runner-errors-spec.js +0 -1
  77. package/test/browser/runner-legacy-options.js +0 -1
  78. package/test/browser/runner-no-js-errors-spec.js +0 -1
  79. package/test/browser/runner-production-options.js +0 -1
  80. package/test/browser/runner-relative-urls-options.js +0 -1
  81. package/test/browser/runner-rootpath-options.js +0 -1
  82. package/test/browser/runner-rootpath-relative-options.js +0 -1
  83. package/test/browser/runner-strict-units-options.js +0 -1
  84. package/test/copy-bom.js +72 -0
  85. package/test/css/comments.css +1 -0
  86. package/test/css/css-3.css +2 -0
  87. package/test/css/functions.css +2 -0
  88. package/test/css/import-interpolation.css +6 -0
  89. package/test/css/import-reference.css +25 -0
  90. package/test/css/include-path/include-path.css +6 -0
  91. package/test/css/mixins-important.css +6 -0
  92. package/test/css/selectors.css +10 -1
  93. package/test/css/url-args/urls.css +3 -3
  94. package/test/css/urls.css +12 -4
  95. package/test/css/variables.css +7 -1
  96. package/test/data/image.svg +3 -0
  97. package/test/index.js +14 -10
  98. package/test/less/comments.less +1 -0
  99. package/test/less/css-3.less +3 -0
  100. package/test/less/css-guards.less +2 -1
  101. package/test/less/errors/detached-ruleset-2.txt +1 -1
  102. package/test/less/errors/import-missing.txt +1 -1
  103. package/test/less/errors/parens-error-1.txt +1 -1
  104. package/test/less/errors/parens-error-2.txt +1 -1
  105. package/test/less/errors/parens-error-3.txt +1 -1
  106. package/test/less/errors/single-character.less +1 -0
  107. package/test/less/errors/single-character.txt +2 -0
  108. package/test/less/functions.less +5 -0
  109. package/test/less/import/import-interpolation.less +1 -0
  110. package/test/less/import/import-reference.less +38 -0
  111. package/test/less/import-reference.less +3 -1
  112. package/test/less/import.less +2 -0
  113. package/test/less/include-path/include-path.less +6 -0
  114. package/test/less/mixins-important.less +12 -0
  115. package/test/less/nested-gradient-with-svg-gradient/mixin-consumer.less +5 -0
  116. package/test/less/nested-gradient-with-svg-gradient/svg-gradient-mixin.less +15 -0
  117. package/test/less/selectors.less +19 -4
  118. package/test/less/urls.less +10 -1
  119. package/test/less/variables.less +17 -3
  120. package/test/less-bom/charsets.less +3 -0
  121. package/test/less-bom/colors.less +98 -0
  122. package/test/less-bom/comments.less +102 -0
  123. package/test/less-bom/comments2.less +20 -0
  124. package/test/less-bom/compression/compression.less +36 -0
  125. package/test/less-bom/css-3.less +154 -0
  126. package/test/less-bom/css-escapes.less +33 -0
  127. package/test/less-bom/css-guards.less +103 -0
  128. package/test/less-bom/css.less +108 -0
  129. package/test/less-bom/debug/import/test.less +25 -0
  130. package/test/less-bom/debug/linenumbers.less +33 -0
  131. package/test/less-bom/detached-rulesets.less +103 -0
  132. package/test/less-bom/empty.less +1 -0
  133. package/test/less-bom/errors/add-mixed-units.less +3 -0
  134. package/test/less-bom/errors/add-mixed-units.txt +4 -0
  135. package/test/less-bom/errors/add-mixed-units2.less +3 -0
  136. package/test/less-bom/errors/add-mixed-units2.txt +4 -0
  137. package/test/less-bom/errors/at-rules-undefined-var.less +4 -0
  138. package/test/less-bom/errors/at-rules-undefined-var.txt +4 -0
  139. package/test/less-bom/errors/bad-variable-declaration1.less +1 -0
  140. package/test/less-bom/errors/bad-variable-declaration1.txt +2 -0
  141. package/test/less-bom/errors/color-func-invalid-color.less +3 -0
  142. package/test/less-bom/errors/color-func-invalid-color.txt +4 -0
  143. package/test/less-bom/errors/color-invalid-hex-code.less +3 -0
  144. package/test/less-bom/errors/color-invalid-hex-code.txt +4 -0
  145. package/test/less-bom/errors/color-invalid-hex-code2.less +3 -0
  146. package/test/less-bom/errors/color-invalid-hex-code2.txt +4 -0
  147. package/test/less-bom/errors/css-guard-default-func.less +4 -0
  148. package/test/less-bom/errors/css-guard-default-func.txt +4 -0
  149. package/test/less-bom/errors/detached-ruleset-1.less +6 -0
  150. package/test/less-bom/errors/detached-ruleset-1.txt +4 -0
  151. package/test/less-bom/errors/detached-ruleset-2.less +6 -0
  152. package/test/less-bom/errors/detached-ruleset-2.txt +4 -0
  153. package/test/less-bom/errors/detached-ruleset-3.less +4 -0
  154. package/test/less-bom/errors/detached-ruleset-3.txt +4 -0
  155. package/test/less-bom/errors/detached-ruleset-4.less +5 -0
  156. package/test/less-bom/errors/detached-ruleset-4.txt +4 -0
  157. package/test/less-bom/errors/detached-ruleset-5.less +4 -0
  158. package/test/less-bom/errors/detached-ruleset-5.txt +3 -0
  159. package/test/less-bom/errors/detached-ruleset-6.less +5 -0
  160. package/test/less-bom/errors/detached-ruleset-6.txt +4 -0
  161. package/test/less-bom/errors/divide-mixed-units.less +3 -0
  162. package/test/less-bom/errors/divide-mixed-units.txt +4 -0
  163. package/test/less-bom/errors/extend-no-selector.less +3 -0
  164. package/test/less-bom/errors/extend-no-selector.txt +3 -0
  165. package/test/less-bom/errors/extend-not-at-end.less +3 -0
  166. package/test/less-bom/errors/extend-not-at-end.txt +3 -0
  167. package/test/less-bom/errors/import-malformed.less +1 -0
  168. package/test/less-bom/errors/import-malformed.txt +3 -0
  169. package/test/less-bom/errors/import-missing.less +6 -0
  170. package/test/less-bom/errors/import-missing.txt +3 -0
  171. package/test/less-bom/errors/import-no-semi.less +1 -0
  172. package/test/less-bom/errors/import-no-semi.txt +2 -0
  173. package/test/less-bom/errors/import-subfolder1.less +1 -0
  174. package/test/less-bom/errors/import-subfolder1.txt +3 -0
  175. package/test/less-bom/errors/import-subfolder2.less +1 -0
  176. package/test/less-bom/errors/import-subfolder2.txt +4 -0
  177. package/test/less-bom/errors/imports/import-subfolder1.less +1 -0
  178. package/test/less-bom/errors/imports/import-subfolder2.less +1 -0
  179. package/test/less-bom/errors/imports/import-test.less +4 -0
  180. package/test/less-bom/errors/imports/subfolder/mixin-not-defined.less +1 -0
  181. package/test/less-bom/errors/imports/subfolder/parse-error-curly-bracket.less +1 -0
  182. package/test/less-bom/errors/javascript-error.less +3 -0
  183. package/test/less-bom/errors/javascript-error.txt +4 -0
  184. package/test/less-bom/errors/javascript-undefined-var.less +3 -0
  185. package/test/less-bom/errors/javascript-undefined-var.txt +4 -0
  186. package/test/less-bom/errors/mixed-mixin-definition-args-1.less +6 -0
  187. package/test/less-bom/errors/mixed-mixin-definition-args-1.txt +4 -0
  188. package/test/less-bom/errors/mixed-mixin-definition-args-2.less +6 -0
  189. package/test/less-bom/errors/mixed-mixin-definition-args-2.txt +4 -0
  190. package/test/less-bom/errors/mixin-not-defined.less +11 -0
  191. package/test/less-bom/errors/mixin-not-defined.txt +3 -0
  192. package/test/less-bom/errors/mixin-not-matched.less +6 -0
  193. package/test/less-bom/errors/mixin-not-matched.txt +3 -0
  194. package/test/less-bom/errors/mixin-not-matched2.less +6 -0
  195. package/test/less-bom/errors/mixin-not-matched2.txt +3 -0
  196. package/test/less-bom/errors/mixin-not-visible-in-scope-1.less +9 -0
  197. package/test/less-bom/errors/mixin-not-visible-in-scope-1.txt +4 -0
  198. package/test/less-bom/errors/mixins-guards-default-func-1.less +9 -0
  199. package/test/less-bom/errors/mixins-guards-default-func-1.txt +4 -0
  200. package/test/less-bom/errors/mixins-guards-default-func-2.less +9 -0
  201. package/test/less-bom/errors/mixins-guards-default-func-2.txt +4 -0
  202. package/test/less-bom/errors/mixins-guards-default-func-3.less +9 -0
  203. package/test/less-bom/errors/mixins-guards-default-func-3.txt +4 -0
  204. package/test/less-bom/errors/multiple-guards-on-css-selectors.less +4 -0
  205. package/test/less-bom/errors/multiple-guards-on-css-selectors.txt +4 -0
  206. package/test/less-bom/errors/multiple-guards-on-css-selectors2.less +4 -0
  207. package/test/less-bom/errors/multiple-guards-on-css-selectors2.txt +4 -0
  208. package/test/less-bom/errors/multiply-mixed-units.less +7 -0
  209. package/test/less-bom/errors/multiply-mixed-units.txt +4 -0
  210. package/test/less-bom/errors/parens-error-1.less +3 -0
  211. package/test/less-bom/errors/parens-error-1.txt +4 -0
  212. package/test/less-bom/errors/parens-error-2.less +3 -0
  213. package/test/less-bom/errors/parens-error-2.txt +4 -0
  214. package/test/less-bom/errors/parens-error-3.less +3 -0
  215. package/test/less-bom/errors/parens-error-3.txt +4 -0
  216. package/test/less-bom/errors/parse-error-curly-bracket.less +4 -0
  217. package/test/less-bom/errors/parse-error-curly-bracket.txt +4 -0
  218. package/test/less-bom/errors/parse-error-extra-parens.less +5 -0
  219. package/test/less-bom/errors/parse-error-extra-parens.txt +3 -0
  220. package/test/less-bom/errors/parse-error-missing-bracket.less +2 -0
  221. package/test/less-bom/errors/parse-error-missing-bracket.txt +3 -0
  222. package/test/less-bom/errors/parse-error-missing-parens.less +5 -0
  223. package/test/less-bom/errors/parse-error-missing-parens.txt +3 -0
  224. package/test/less-bom/errors/parse-error-with-import.less +13 -0
  225. package/test/less-bom/errors/parse-error-with-import.txt +4 -0
  226. package/test/less-bom/errors/percentage-missing-space.less +3 -0
  227. package/test/less-bom/errors/percentage-missing-space.txt +4 -0
  228. package/test/less-bom/errors/property-asterisk-only-name.less +3 -0
  229. package/test/less-bom/errors/property-asterisk-only-name.txt +4 -0
  230. package/test/less-bom/errors/property-ie5-hack.less +3 -0
  231. package/test/less-bom/errors/property-ie5-hack.txt +3 -0
  232. package/test/less-bom/errors/property-in-root.less +4 -0
  233. package/test/less-bom/errors/property-in-root.txt +4 -0
  234. package/test/less-bom/errors/property-in-root2.less +1 -0
  235. package/test/less-bom/errors/property-in-root2.txt +4 -0
  236. package/test/less-bom/errors/property-in-root3.less +4 -0
  237. package/test/less-bom/errors/property-in-root3.txt +3 -0
  238. package/test/less-bom/errors/property-interp-not-defined.less +1 -0
  239. package/test/less-bom/errors/property-interp-not-defined.txt +2 -0
  240. package/test/less-bom/errors/recursive-variable.less +1 -0
  241. package/test/less-bom/errors/recursive-variable.txt +2 -0
  242. package/test/less-bom/errors/single-character.less +1 -0
  243. package/test/less-bom/errors/single-character.txt +2 -0
  244. package/test/less-bom/errors/svg-gradient1.less +3 -0
  245. package/test/less-bom/errors/svg-gradient1.txt +4 -0
  246. package/test/less-bom/errors/svg-gradient2.less +3 -0
  247. package/test/less-bom/errors/svg-gradient2.txt +4 -0
  248. package/test/less-bom/errors/svg-gradient3.less +3 -0
  249. package/test/less-bom/errors/svg-gradient3.txt +4 -0
  250. package/test/less-bom/errors/unit-function.less +3 -0
  251. package/test/less-bom/errors/unit-function.txt +4 -0
  252. package/test/less-bom/extend-chaining.less +91 -0
  253. package/test/less-bom/extend-clearfix.less +19 -0
  254. package/test/less-bom/extend-exact.less +46 -0
  255. package/test/less-bom/extend-media.less +24 -0
  256. package/test/less-bom/extend-nest.less +65 -0
  257. package/test/less-bom/extend-selector.less +99 -0
  258. package/test/less-bom/extend.less +81 -0
  259. package/test/less-bom/extract-and-length.less +133 -0
  260. package/test/less-bom/functions.less +201 -0
  261. package/test/less-bom/globalVars/extended.json +5 -0
  262. package/test/less-bom/globalVars/extended.less +10 -0
  263. package/test/less-bom/globalVars/simple.json +3 -0
  264. package/test/less-bom/globalVars/simple.less +3 -0
  265. package/test/less-bom/ie-filters.less +15 -0
  266. package/test/less-bom/import/deeper/deeper-2/url-import-2.less +3 -0
  267. package/test/less-bom/import/deeper/deeper-2/url-import.less +1 -0
  268. package/test/less-bom/import/deeper/import-once-test-a.less +1 -0
  269. package/test/less-bom/import/deeper/url-import.less +1 -0
  270. package/test/less-bom/import/import-and-relative-paths-test.less +17 -0
  271. package/test/less-bom/import/import-charset-test.less +1 -0
  272. package/test/less-bom/import/import-interpolation.less +2 -0
  273. package/test/less-bom/import/import-interpolation2.less +5 -0
  274. package/test/less-bom/import/import-once-test-c.less +6 -0
  275. package/test/less-bom/import/import-reference.less +89 -0
  276. package/test/less-bom/import/import-test-a.less +4 -0
  277. package/test/less-bom/import/import-test-b.less +8 -0
  278. package/test/less-bom/import/import-test-c.less +6 -0
  279. package/test/less-bom/import/import-test-d.css +1 -0
  280. package/test/less-bom/import/import-test-e.less +2 -0
  281. package/test/less-bom/import/import-test-f.less +5 -0
  282. package/test/less-bom/import/imports/font.less +8 -0
  283. package/test/less-bom/import/imports/logo.less +5 -0
  284. package/test/less-bom/import/interpolation-vars.less +6 -0
  285. package/test/less-bom/import/invalid-css.less +1 -0
  286. package/test/less-bom/import/urls.less +1 -0
  287. package/test/less-bom/import-inline.less +3 -0
  288. package/test/less-bom/import-interpolation.less +8 -0
  289. package/test/less-bom/import-once.less +6 -0
  290. package/test/less-bom/import-reference.less +23 -0
  291. package/test/less-bom/import.less +30 -0
  292. package/test/less-bom/include-path/include-path.less +6 -0
  293. package/test/less-bom/javascript.less +38 -0
  294. package/test/less-bom/lazy-eval.less +6 -0
  295. package/test/less-bom/legacy/legacy.less +7 -0
  296. package/test/less-bom/media.less +234 -0
  297. package/test/less-bom/merge.less +78 -0
  298. package/test/less-bom/mixins-args.less +215 -0
  299. package/test/less-bom/mixins-closure.less +26 -0
  300. package/test/less-bom/mixins-guards-default-func.less +195 -0
  301. package/test/less-bom/mixins-guards.less +271 -0
  302. package/test/less-bom/mixins-important.less +37 -0
  303. package/test/less-bom/mixins-interpolated.less +75 -0
  304. package/test/less-bom/mixins-named-args.less +36 -0
  305. package/test/less-bom/mixins-nested.less +22 -0
  306. package/test/less-bom/mixins-pattern.less +102 -0
  307. package/test/less-bom/mixins.less +145 -0
  308. package/test/less-bom/modifyVars/extended.json +5 -0
  309. package/test/less-bom/modifyVars/extended.less +11 -0
  310. package/test/less-bom/nested-gradient-with-svg-gradient/mixin-consumer.less +5 -0
  311. package/test/less-bom/nested-gradient-with-svg-gradient/svg-gradient-mixin.less +15 -0
  312. package/test/less-bom/no-js-errors/no-js-errors.less +3 -0
  313. package/test/less-bom/no-js-errors/no-js-errors.txt +4 -0
  314. package/test/less-bom/no-output.less +2 -0
  315. package/test/less-bom/operations.less +62 -0
  316. package/test/less-bom/parens.less +45 -0
  317. package/test/less-bom/property-name-interp.less +56 -0
  318. package/test/less-bom/rulesets.less +30 -0
  319. package/test/less-bom/scope.less +104 -0
  320. package/test/less-bom/selectors.less +174 -0
  321. package/test/less-bom/sourcemaps/basic.json +3 -0
  322. package/test/less-bom/sourcemaps/basic.less +27 -0
  323. package/test/less-bom/sourcemaps/imported.css +7 -0
  324. package/test/less-bom/static-urls/urls.less +33 -0
  325. package/test/less-bom/strict-units/strict-units.less +4 -0
  326. package/test/less-bom/strings.less +73 -0
  327. package/test/less-bom/url-args/urls.less +63 -0
  328. package/test/less-bom/urls.less +94 -0
  329. package/test/less-bom/variables-in-at-rules.less +20 -0
  330. package/test/less-bom/variables.less +119 -0
  331. package/test/less-bom/whitespace.less +44 -0
  332. package/test/less-test.js +127 -28
  333. package/test/modify-vars.js +6 -4
@@ -2,4 +2,3 @@ var less = {
2
2
  strictUnits: true,
3
3
  strictMath: true,
4
4
  logLevel: 4 };
5
-
@@ -1,4 +1,3 @@
1
1
  describe("less.js error tests", function() {
2
2
  testLessErrorsInDocument();
3
3
  });
4
-
@@ -3,4 +3,3 @@ var less = {
3
3
  errorReporting: "console",
4
4
  strictMath: false,
5
5
  strictUnits: false };
6
-
@@ -1,4 +1,3 @@
1
1
  describe("less.js javascript disabled error tests", function() {
2
2
  testLessErrorsInDocument();
3
3
  });
4
-
@@ -1,4 +1,3 @@
1
1
  var less = {logLevel: 4,
2
2
  errorReporting: "console"};
3
3
  less.env = "production";
4
-
@@ -1,4 +1,3 @@
1
1
  var less = {logLevel: 4,
2
2
  errorReporting: "console"};
3
3
  less.relativeUrls = true;
4
-
@@ -1,4 +1,3 @@
1
1
  var less = {logLevel: 4,
2
2
  errorReporting: "console"};
3
3
  less.rootpath = "https://localhost/";
4
-
@@ -2,4 +2,3 @@ var less = {logLevel: 4,
2
2
  errorReporting: "console"};
3
3
  less.rootpath = "https://www.github.com/cloudhead/less.js/";
4
4
  less.relativeUrls = true;
5
-
@@ -3,4 +3,3 @@ var less = {
3
3
  errorReporting: "console",
4
4
  strictMath: true,
5
5
  strictUnits: true };
6
-
@@ -0,0 +1,72 @@
1
+ /*jshint latedef: nofunc */
2
+
3
+ // This is used to copy a folder (the test/less/* files & sub-folders), adding a BOM to the start of each LESS and CSS file.
4
+ // This is a based on the copySync method from fs-extra (https://github.com/jprichardson/node-fs-extra/).
5
+
6
+ module.exports = function() {
7
+ var path = require('path'),
8
+ fs = require('fs');
9
+
10
+ var BUF_LENGTH = 64 * 1024;
11
+ var _buff = new Buffer(BUF_LENGTH);
12
+
13
+ function copyFolderWithBom(src, dest) {
14
+ var stats = fs.lstatSync(src);
15
+ var destFolder = path.dirname(dest);
16
+ var destFolderExists = fs.existsSync(destFolder);
17
+ var performCopy = false;
18
+
19
+ if (stats.isFile()) {
20
+ if (!destFolderExists) {
21
+ fs.mkdirSync(destFolder);
22
+ }
23
+ if (src.match(/\.(css|less)$/)) {
24
+ copyFileAddingBomSync(src, dest);
25
+ } else {
26
+ copyFileSync(src, dest);
27
+ }
28
+ }
29
+ else if (stats.isDirectory()) {
30
+ if (!fs.existsSync(destFolder)) {
31
+ fs.mkdirSync(destFolder);
32
+ }
33
+ if (!fs.existsSync(dest)) {
34
+ fs.mkdirSync(dest);
35
+ }
36
+ fs.readdirSync(src).forEach(function(d) {
37
+ if (d !== 'bom') {
38
+ copyFolderWithBom(path.join(src, d), path.join(dest, d));
39
+ }
40
+ });
41
+ }
42
+ }
43
+
44
+ function copyFileAddingBomSync(srcFile, destFile) {
45
+ var contents = fs.readFileSync(srcFile, { encoding: 'utf8' });
46
+ if (!contents.length || contents.charCodeAt(0) !== 0xFEFF) {
47
+ contents = '\ufeff' + contents;
48
+ }
49
+ fs.writeFileSync(destFile, contents, { encoding: 'utf8' });
50
+ }
51
+
52
+ function copyFileSync(srcFile, destFile) {
53
+ var fdr = fs.openSync(srcFile, 'r')
54
+ var stat = fs.fstatSync(fdr)
55
+ var fdw = fs.openSync(destFile, 'w', stat.mode)
56
+ var bytesRead = 1
57
+ var pos = 0
58
+
59
+ while (bytesRead > 0) {
60
+ bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos)
61
+ fs.writeSync(fdw, _buff, 0, bytesRead)
62
+ pos += bytesRead
63
+ }
64
+
65
+ fs.closeSync(fdr)
66
+ fs.closeSync(fdw)
67
+ }
68
+
69
+ return {
70
+ copyFolderWithBom: copyFolderWithBom
71
+ };
72
+ };
@@ -80,3 +80,4 @@
80
80
  #output-block {
81
81
  comment: /* // Not commented out // */;
82
82
  }
83
+ /*comment on last line*/
@@ -147,3 +147,5 @@ body ^^ .shadow {
147
147
  symbols: ‣;
148
148
  suffix: " ";
149
149
  }
150
+ @-ms-viewport {
151
+ }
@@ -127,6 +127,7 @@
127
127
  mixt: rgba(255, 0, 0, 0.5);
128
128
  }
129
129
  #built-in .is-a {
130
+ ruleset: true;
130
131
  color: true;
131
132
  color1: true;
132
133
  color2: true;
@@ -138,6 +139,7 @@
138
139
  percent: true;
139
140
  em: true;
140
141
  cat: true;
142
+ no-unit-is-empty: true;
141
143
  case-insensitive-1: true;
142
144
  case-insensitive-2: true;
143
145
  }
@@ -1,6 +1,12 @@
1
1
  body {
2
2
  width: 100%;
3
3
  }
4
+ #logo {
5
+ width: 100px;
6
+ height: 100px;
7
+ background: url('../assets/logo.png');
8
+ }
9
+
4
10
  .a {
5
11
  var: test;
6
12
  }
@@ -34,6 +34,14 @@ div#id.class[a=1][b=2].class:not(1) {
34
34
  .visible + .visible .sub {
35
35
  color: green;
36
36
  }
37
+ @supports (something: else) {
38
+ .class {
39
+ something: else;
40
+ }
41
+ .nestedToo .class {
42
+ something: else;
43
+ }
44
+ }
37
45
  .b {
38
46
  color: red;
39
47
  color: green;
@@ -66,3 +74,20 @@ div#id.class[a=1][b=2].class:not(1) {
66
74
  color: red;
67
75
  }
68
76
  }
77
+ .test {
78
+ color: red;
79
+ }
80
+ .test:first-child {
81
+ color: blue;
82
+ }
83
+ @keyframes some-name {
84
+ property: value;
85
+ }
86
+ @supports (animation-name: test) {
87
+ @keyframes some-name {
88
+ property: value;
89
+ }
90
+ .selector {
91
+ color: red;
92
+ }
93
+ }
@@ -0,0 +1,6 @@
1
+ body {
2
+ width: 100%;
3
+ }
4
+ data-uri {
5
+ property: url("data:image/svg+xml,%3Csvg%20height%3D%22100%22%20width%3D%22100%22%3E%0A%20%20%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2240%22%20stroke%3D%22black%22%20stroke-width%3D%221%22%20fill%3D%22blue%22%20%2F%3E%0A%3C%2Fsvg%3E");
6
+ }
@@ -43,3 +43,9 @@
43
43
  .class .inner {
44
44
  test: 9;
45
45
  }
46
+ .when-calling-nested-issue-2394 {
47
+ width: auto !important;
48
+ }
49
+ .when-calling-nested-with-param-issue-2394 {
50
+ width: 10px !important;
51
+ }
@@ -119,7 +119,7 @@ p a span {
119
119
  .bloodred {
120
120
  color: green;
121
121
  }
122
- #blood.blood.red.black {
122
+ #blood.blood.red.black:blood {
123
123
  color: black;
124
124
  }
125
125
  :nth-child(3) {
@@ -154,3 +154,12 @@ blank blank blank blank blank blank blank blank blank blank blank blank blank bl
154
154
  .blood {
155
155
  color: red;
156
156
  }
157
+ .foo:not(.tst.only-nested .level2:hover) {
158
+ test: only-nested;
159
+ }
160
+ .foo.nestend-and-non-nested:not(.tst.nestend-and-non-nested:hover) {
161
+ test: nestend-and-non-nested;
162
+ }
163
+ .selector:not(:hover) {
164
+ test: global scope;
165
+ }
@@ -46,9 +46,9 @@
46
46
  uri-2: url("data:text/html,%3Ch1%3EThis%20page%20is%20100%25%20Awesome.%3C%2Fh1%3E%0A");
47
47
  }
48
48
  #svg-functions {
49
- background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjxsaW5lYXJHcmFkaWVudCBpZD0iZ3JhZGllbnQiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjwvbGluZWFyR3JhZGllbnQ+PHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkaWVudCkiIC8+PC9zdmc+');
50
- background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjxsaW5lYXJHcmFkaWVudCBpZD0iZ3JhZGllbnQiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIvPjxzdG9wIG9mZnNldD0iMyUiIHN0b3AtY29sb3I9IiNmZmE1MDAiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZmZmZmYiLz48L2xpbmVhckdyYWRpZW50PjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9InVybCgjZ3JhZGllbnQpIiAvPjwvc3ZnPg==');
51
- background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjxsaW5lYXJHcmFkaWVudCBpZD0iZ3JhZGllbnQiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIxJSIgc3RvcC1jb2xvcj0iI2M0YzRjNCIvPjxzdG9wIG9mZnNldD0iMyUiIHN0b3AtY29sb3I9IiNmZmE1MDAiLz48c3RvcCBvZmZzZXQ9IjUlIiBzdG9wLWNvbG9yPSIjMDA4MDAwIi8+PHN0b3Agb2Zmc2V0PSI5NSUiIHN0b3AtY29sb3I9IiNmZmZmZmYiLz48L2xpbmVhckdyYWRpZW50PjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9InVybCgjZ3JhZGllbnQpIiAvPjwvc3ZnPg==');
49
+ background-image: url('data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%201%201%22%20preserveAspectRatio%3D%22none%22%3E%3ClinearGradient%20id%3D%22gradient%22%20gradientUnits%3D%22userSpaceOnUse%22%20x1%3D%220%25%22%20y1%3D%220%25%22%20x2%3D%220%25%22%20y2%3D%22100%25%22%3E%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%23000000%22%2F%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23ffffff%22%2F%3E%3C%2FlinearGradient%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22url(%23gradient)%22%20%2F%3E%3C%2Fsvg%3E');
50
+ background-image: url('data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%201%201%22%20preserveAspectRatio%3D%22none%22%3E%3ClinearGradient%20id%3D%22gradient%22%20gradientUnits%3D%22userSpaceOnUse%22%20x1%3D%220%25%22%20y1%3D%220%25%22%20x2%3D%220%25%22%20y2%3D%22100%25%22%3E%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%23000000%22%2F%3E%3Cstop%20offset%3D%223%25%22%20stop-color%3D%22%23ffa500%22%2F%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23ffffff%22%2F%3E%3C%2FlinearGradient%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22url(%23gradient)%22%20%2F%3E%3C%2Fsvg%3E');
51
+ background-image: url('data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%201%201%22%20preserveAspectRatio%3D%22none%22%3E%3ClinearGradient%20id%3D%22gradient%22%20gradientUnits%3D%22userSpaceOnUse%22%20x1%3D%220%25%22%20y1%3D%220%25%22%20x2%3D%220%25%22%20y2%3D%22100%25%22%3E%3Cstop%20offset%3D%221%25%22%20stop-color%3D%22%23c4c4c4%22%2F%3E%3Cstop%20offset%3D%223%25%22%20stop-color%3D%22%23ffa500%22%2F%3E%3Cstop%20offset%3D%225%25%22%20stop-color%3D%22%23008000%22%2F%3E%3Cstop%20offset%3D%2295%25%22%20stop-color%3D%22%23ffffff%22%2F%3E%3C%2FlinearGradient%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22url(%23gradient)%22%20%2F%3E%3C%2Fsvg%3E');
52
52
  }
53
53
  #data-uri-with-spaces {
54
54
  background-image: url(data:image/x-png,f9difSSFIIGFIFJD1f982FSDKAA9==);
package/test/css/urls.css CHANGED
@@ -1,6 +1,9 @@
1
1
  @import "css/background.css";
2
2
  @import "import/import-test-d.css";
3
3
  @import "file.css";
4
+ .gray-gradient {
5
+ background: url('data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%201%201%22%20preserveAspectRatio%3D%22none%22%3E%3ClinearGradient%20id%3D%22gradient%22%20gradientUnits%3D%22userSpaceOnUse%22%20x1%3D%220%25%22%20y1%3D%220%25%22%20x2%3D%220%25%22%20y2%3D%22100%25%22%3E%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220%22%2F%3E%3Cstop%20offset%3D%2260%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.05%22%2F%3E%3Cstop%20offset%3D%2270%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.1%22%2F%3E%3Cstop%20offset%3D%2273%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.15%22%2F%3E%3Cstop%20offset%3D%2275%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.2%22%2F%3E%3Cstop%20offset%3D%2280%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.25%22%2F%3E%3Cstop%20offset%3D%2285%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.3%22%2F%3E%3Cstop%20offset%3D%2288%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.35%22%2F%3E%3Cstop%20offset%3D%2290%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.4%22%2F%3E%3Cstop%20offset%3D%2295%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.45%22%2F%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.5%22%2F%3E%3C%2FlinearGradient%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22url(%23gradient)%22%20%2F%3E%3C%2Fsvg%3E');
6
+ }
4
7
  @font-face {
5
8
  src: url("/fonts/garamond-pro.ttf");
6
9
  src: local(Futura-Medium), url(fonts.svg#MyGeometricModern) format("svg");
@@ -54,6 +57,7 @@
54
57
  }
55
58
  #data-uri {
56
59
  uri: url("data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg==");
60
+ background-image: url("data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg=="), url("data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg==");
57
61
  uri-fragment: url("data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg==#fragment");
58
62
  }
59
63
  #data-uri-guess {
@@ -63,13 +67,17 @@
63
67
  uri-1: url("data:text/html,%3Ch1%3EThis%20page%20is%20100%25%20Awesome.%3C%2Fh1%3E%0A");
64
68
  uri-2: url("data:text/html,%3Ch1%3EThis%20page%20is%20100%25%20Awesome.%3C%2Fh1%3E%0A");
65
69
  }
66
- #data-uri-toobig {
70
+ #file-functions {
67
71
  uri: url('../data/data-uri-fail.png');
72
+ svg-not-base-64: url("data:image/svg+xml,%3Csvg%20height%3D%22100%22%20width%3D%22100%22%3E%0A%20%20%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2240%22%20stroke%3D%22black%22%20stroke-width%3D%221%22%20fill%3D%22blue%22%20%2F%3E%0A%3C%2Fsvg%3E");
73
+ size: 640px 430px;
74
+ width: 640px;
75
+ height: 430px;
68
76
  }
69
77
  #svg-functions {
70
- background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjxsaW5lYXJHcmFkaWVudCBpZD0iZ3JhZGllbnQiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjwvbGluZWFyR3JhZGllbnQ+PHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkaWVudCkiIC8+PC9zdmc+');
71
- background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjxsaW5lYXJHcmFkaWVudCBpZD0iZ3JhZGllbnQiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIvPjxzdG9wIG9mZnNldD0iMyUiIHN0b3AtY29sb3I9IiNmZmE1MDAiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZmZmZmYiLz48L2xpbmVhckdyYWRpZW50PjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9InVybCgjZ3JhZGllbnQpIiAvPjwvc3ZnPg==');
72
- background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjxsaW5lYXJHcmFkaWVudCBpZD0iZ3JhZGllbnQiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIxJSIgc3RvcC1jb2xvcj0iI2M0YzRjNCIvPjxzdG9wIG9mZnNldD0iMyUiIHN0b3AtY29sb3I9IiNmZmE1MDAiLz48c3RvcCBvZmZzZXQ9IjUlIiBzdG9wLWNvbG9yPSIjMDA4MDAwIi8+PHN0b3Agb2Zmc2V0PSI5NSUiIHN0b3AtY29sb3I9IiNmZmZmZmYiLz48L2xpbmVhckdyYWRpZW50PjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9InVybCgjZ3JhZGllbnQpIiAvPjwvc3ZnPg==');
78
+ background-image: url('data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%201%201%22%20preserveAspectRatio%3D%22none%22%3E%3ClinearGradient%20id%3D%22gradient%22%20gradientUnits%3D%22userSpaceOnUse%22%20x1%3D%220%25%22%20y1%3D%220%25%22%20x2%3D%220%25%22%20y2%3D%22100%25%22%3E%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%23000000%22%2F%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23ffffff%22%2F%3E%3C%2FlinearGradient%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22url(%23gradient)%22%20%2F%3E%3C%2Fsvg%3E');
79
+ background-image: url('data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%201%201%22%20preserveAspectRatio%3D%22none%22%3E%3ClinearGradient%20id%3D%22gradient%22%20gradientUnits%3D%22userSpaceOnUse%22%20x1%3D%220%25%22%20y1%3D%220%25%22%20x2%3D%220%25%22%20y2%3D%22100%25%22%3E%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%23000000%22%2F%3E%3Cstop%20offset%3D%223%25%22%20stop-color%3D%22%23ffa500%22%2F%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23ffffff%22%2F%3E%3C%2FlinearGradient%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22url(%23gradient)%22%20%2F%3E%3C%2Fsvg%3E');
80
+ background-image: url('data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%201%201%22%20preserveAspectRatio%3D%22none%22%3E%3ClinearGradient%20id%3D%22gradient%22%20gradientUnits%3D%22userSpaceOnUse%22%20x1%3D%220%25%22%20y1%3D%220%25%22%20x2%3D%220%25%22%20y2%3D%22100%25%22%3E%3Cstop%20offset%3D%221%25%22%20stop-color%3D%22%23c4c4c4%22%2F%3E%3Cstop%20offset%3D%223%25%22%20stop-color%3D%22%23ffa500%22%2F%3E%3Cstop%20offset%3D%225%25%22%20stop-color%3D%22%23008000%22%2F%3E%3Cstop%20offset%3D%2295%25%22%20stop-color%3D%22%23ffffff%22%2F%3E%3C%2FlinearGradient%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22url(%23gradient)%22%20%2F%3E%3C%2Fsvg%3E');
73
81
  }
74
82
  @font-face {
75
83
  font-family: 'MyWebFont';
@@ -22,7 +22,13 @@
22
22
  multi-important: #888888 #888888, 'Trebuchet' !important;
23
23
  multi: something 'A', B, C, 'Trebuchet';
24
24
  }
25
- .variable-names {
25
+ .variable-names .quoted {
26
+ name: 'hello';
27
+ }
28
+ .variable-names .unquoted {
29
+ name: 'hello';
30
+ }
31
+ .variable-names .color-keyword {
26
32
  name: 'hello';
27
33
  }
28
34
  .alpha {
@@ -0,0 +1,3 @@
1
+ <svg height="100" width="100">
2
+ <circle cx="50" cy="50" r="40" stroke="black" stroke-width="1" fill="blue" />
3
+ </svg>
package/test/index.js CHANGED
@@ -4,17 +4,19 @@ var lessTest = require("./less-test"),
4
4
  stylize = require('../lib/less-node/lessc-helper').stylize;
5
5
 
6
6
  function getErrorPathReplacementFunction(dir) {
7
- return function(input) {
8
- return input.replace(
9
- "{path}", path.join(process.cwd(), "/test/less/" + dir + "/"))
10
- .replace("{pathrel}", path.join("test", "less", dir + "/"))
11
- .replace("{pathhref}", "")
12
- .replace("{404status}", "")
7
+ return function(input, baseDir) {
8
+ return input.replace(/\{path\}/g, path.join(process.cwd(), baseDir, dir + "/"))
9
+ .replace(/\{node\}/g, "")
10
+ .replace(/\{\/node\}/g, "")
11
+ .replace(/\{pathrel\}/g, path.join(baseDir, dir + "/"))
12
+ .replace(/\{pathhref\}/g, "")
13
+ .replace(/\{404status\}/g, "")
13
14
  .replace(/\r\n/g, '\n');
14
15
  };
15
16
  }
16
17
 
17
18
  console.log("\n" + stylize("Less", 'underline') + "\n");
19
+ lessTester.prepBomTest();
18
20
  lessTester.runTestSet({strictMath: true, relativeUrls: true, silent: true});
19
21
  lessTester.runTestSet({strictMath: true, strictUnits: true}, "errors/",
20
22
  lessTester.testErrors, null, getErrorPathReplacementFunction("errors"));
@@ -32,17 +34,19 @@ lessTester.runTestSet({strictMath: true, strictUnits: true}, "strict-units/");
32
34
  lessTester.runTestSet({}, "legacy/");
33
35
  lessTester.runTestSet({strictMath: true, strictUnits: true, sourceMap: true, globalVars: true }, "sourcemaps/",
34
36
  lessTester.testSourcemap, null, null,
35
- function(filename, type) {
37
+ function(filename, type, baseFolder) {
36
38
  if (type === "vars") {
37
- return path.join('test/less/', filename) + '.json';
39
+ return path.join(baseFolder, filename) + '.json';
38
40
  }
39
41
  return path.join('test/sourcemaps', filename) + '.json';
40
42
  });
41
43
  lessTester.runTestSet({globalVars: true, banner: "/**\n * Test\n */\n"}, "globalVars/",
42
- null, null, null, function(name) { return path.join('test/less/', name) + '.json'; });
44
+ null, null, null, function(name, type, baseFolder) { return path.join(baseFolder, name) + '.json'; });
43
45
  lessTester.runTestSet({modifyVars: true}, "modifyVars/",
44
- null, null, null, function(name) { return path.join('test/less/', name) + '.json'; });
46
+ null, null, null, function(name, type, baseFolder) { return path.join(baseFolder, name) + '.json'; });
45
47
  lessTester.runTestSet({urlArgs: '424242'}, "url-args/");
48
+ lessTester.runTestSet({paths: ['test/data/', 'test/less/import/']}, "include-path/");
46
49
  lessTester.testSyncronous({syncImport: true}, "import");
47
50
  lessTester.testSyncronous({syncImport: true}, "css");
48
51
  lessTester.testNoOptions();
52
+ lessTester.finished();
@@ -99,3 +99,4 @@
99
99
  /*by block */
100
100
  @string_w_comment: ~"/* // Not commented out // */";
101
101
  #output-block { comment: @string_w_comment; }
102
+ /*comment on last line*/
@@ -149,3 +149,6 @@ body ^^ .shadow {
149
149
  symbols: ‣;
150
150
  suffix: " ";
151
151
  }
152
+ @-ms-viewport{
153
+ //width: auto !important;
154
+ }
@@ -99,4 +99,5 @@
99
99
  }
100
100
  .errors-if-called when (@c = never) {
101
101
  .mixin-doesnt-exist();
102
- }
102
+ }
103
+ a:hover when (2 = true) {5:-}
@@ -1,4 +1,4 @@
1
- ParseError: Unrecognised input. Possibly missing opening '(' in {path}detached-ruleset-2.less on line 5, column 9:
1
+ ParseError: Expected ')' in {path}detached-ruleset-2.less on line 5, column 9:
2
2
  4 .a {
3
3
  5 a: @a();
4
4
  6 }
@@ -1,3 +1,3 @@
1
- FileError: '{pathhref}file-does-not-exist.less' wasn't found{404status} in {path}import-missing.less on line 6, column 1:
1
+ FileError: '{pathhref}file-does-not-exist.less' wasn't found{404status}{node}. Tried - {path}file-does-not-exist.less,{pathrel}file-does-not-exist.less,file-does-not-exist.less{/node} in {path}import-missing.less on line 6, column 1:
2
2
  5
3
3
  6 @import "file-does-not-exist.less";
@@ -1,4 +1,4 @@
1
- SyntaxError: expected ')' got '(' in {path}parens-error-1.less on line 2, column 18:
1
+ ParseError: Expected ')' in {path}parens-error-1.less on line 2, column 18:
2
2
  1 .a {
3
3
  2 something: (12 (13 + 5 -23) + 5);
4
4
  3 }
@@ -1,4 +1,4 @@
1
- SyntaxError: expected ')' got '-' in {path}parens-error-2.less on line 2, column 28:
1
+ ParseError: Expected ')' in {path}parens-error-2.less on line 2, column 28:
2
2
  1 .a {
3
3
  2 something: (12 * (13 + 5 -23));
4
4
  3 }
@@ -1,4 +1,4 @@
1
- SyntaxError: expected ')' got '-' in {path}parens-error-3.less on line 2, column 29:
1
+ ParseError: Expected ')' in {path}parens-error-3.less on line 2, column 29:
2
2
  1 .a {
3
3
  2 something: (12 + (13 + 10 -23));
4
4
  3 }
@@ -0,0 +1,2 @@
1
+ ParseError: Unrecognised input. Possibly missing something in {path}single-character.less on line 1, column 2:
2
+ 1 x
@@ -137,6 +137,10 @@
137
137
  mixt: mix(#ff0000, transparent);
138
138
 
139
139
  .is-a {
140
+ @rules: {
141
+ color: red;
142
+ };
143
+ ruleset: isruleset(@rules);
140
144
  color: iscolor(#ddd);
141
145
  color1: iscolor(red);
142
146
  color2: iscolor(rgb(0, 0, 0));
@@ -148,6 +152,7 @@
148
152
  percent: ispercentage(32%);
149
153
  em: isem(32em);
150
154
  cat: isunit(32cat, cat);
155
+ no-unit-is-empty: isunit(32, '');
151
156
  case-insensitive-1: isunit(32CAT, cat);
152
157
  case-insensitive-2: isunit(32px, PX);
153
158
  }
@@ -1 +1,2 @@
1
+ @import (inline) "imports/logo.less";
1
2
  @import "import-@{in}@{terpolation}2.less";
@@ -48,4 +48,42 @@
48
48
  @media (max-size: @max-size) {
49
49
  color: red;
50
50
  }
51
+ }
52
+ //https://github.com/less/less.js/issues/2359
53
+ @supports (something: else) {
54
+ .class {
55
+ something: else;
56
+ }
57
+ .nestedToo {
58
+ .class {
59
+ something: else;
60
+ }
61
+ }
62
+ .invisible {
63
+ something: else;
64
+ }
65
+ }
66
+ //https://github.com/less/less.js/issues/1979
67
+ .mixin-with-nested-selectors() {
68
+ .test {
69
+ color: red;
70
+ &:first-child {
71
+ color: blue;
72
+ }
73
+ }
74
+ }
75
+ .mixin-with-directives(@keyframeName) {
76
+ @keyframes @keyframeName {
77
+ @rules1();
78
+ }
79
+ @supports (animation-name: test) {
80
+ @keyframes @keyframeName {
81
+ @rules2();
82
+ }
83
+ .selector {
84
+ color: red;
85
+ }
86
+ }
87
+ @rules1: {property: value;};
88
+ @rules2: {property: value;};
51
89
  }
@@ -18,4 +18,6 @@
18
18
  }
19
19
 
20
20
  .class:extend(.class all) {
21
- }
21
+ }
22
+ .mixin-with-nested-selectors();
23
+ .mixin-with-directives(some-name);
@@ -2,6 +2,8 @@
2
2
 
3
3
  @import url(/absolute/something.css) screen and (color) and (max-width: 600px);
4
4
 
5
+ @import (optional) "file-does-not-exist.does-not-exist";
6
+
5
7
  @var: 100px;
6
8
  @import url("//ha.com/file.css") (min-width:@var);
7
9
 
@@ -0,0 +1,6 @@
1
+ @import "import-test-e";
2
+
3
+ data-uri {
4
+ property: data-uri('image.svg');
5
+ }
6
+
@@ -23,3 +23,15 @@
23
23
  .mixin !important;
24
24
  .mixin(9);
25
25
  }
26
+ .size(@aaa: auto) {
27
+ .set-width(@aaa) {
28
+ width: @aaa;
29
+ }
30
+ .set-width(@aaa);
31
+ }
32
+ .when-calling-nested-issue-2394 {
33
+ .size() !important;
34
+ }
35
+ .when-calling-nested-with-param-issue-2394 {
36
+ .size(10px) !important;
37
+ }
@@ -0,0 +1,5 @@
1
+ @import "svg-gradient-mixin.less";
2
+
3
+ .gray-gradient {
4
+ .gradient-mixin(#999);
5
+ }
@@ -0,0 +1,15 @@
1
+ .gradient-mixin(@color) {
2
+ background: svg-gradient(to bottom,
3
+ fade(@color, 0%) 0%,
4
+ fade(@color, 5%) 60%,
5
+ fade(@color, 10%) 70%,
6
+ fade(@color, 15%) 73%,
7
+ fade(@color, 20%) 75%,
8
+ fade(@color, 25%) 80%,
9
+ fade(@color, 30%) 85%,
10
+ fade(@color, 35%) 88%,
11
+ fade(@color, 40%) 90%,
12
+ fade(@color, 45%) 95%,
13
+ fade(@color, 50%) 100%
14
+ );
15
+ }
@@ -117,13 +117,13 @@ a {
117
117
  color: green;
118
118
  }
119
119
  .red {
120
- #@{theme}.@{theme}&.black {
120
+ #@{theme}.@{theme}&.black:@{theme} {
121
121
  color:black;
122
122
  }
123
123
  }
124
124
  @num: 3;
125
125
  :nth-child(@{num}) {
126
- selector: interpolated;
126
+ selector: interpolated;
127
127
  }
128
128
  .test {
129
129
  &:nth-child(@{num}) {
@@ -132,7 +132,7 @@ a {
132
132
  &:nth-child(odd):not(:nth-child(3)) {
133
133
  color: #ff0000;
134
134
  }
135
- }
135
+ }
136
136
  [prop],
137
137
  [prop=10%],
138
138
  [prop="value@{num}"],
@@ -156,4 +156,19 @@ blank blank blank blank blank blank blank blank blank blank blank blank blank bl
156
156
  */
157
157
  @{selector} {
158
158
  color: red;
159
- }
159
+ }
160
+ .only-nested {
161
+ .level2 {
162
+ .foo:not(.tst&:hover) {
163
+ test: only-nested;
164
+ }
165
+ }
166
+ }
167
+ .nestend-and-non-nested {
168
+ .foo&:not(.tst&:hover) {
169
+ test: nestend-and-non-nested;
170
+ }
171
+ }
172
+ .selector:not(&:hover) {
173
+ test: global scope;
174
+ }