less 2.0.0 → 2.6.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 (468) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +2 -0
  3. data/.gitmodules +1 -4
  4. data/.travis.yml +12 -0
  5. data/Changelog.md +17 -0
  6. data/Gemfile +10 -2
  7. data/README.md +30 -14
  8. data/Rakefile +2 -0
  9. data/bin/lessc +101 -1
  10. data/less.gemspec +5 -8
  11. data/lib/less/defaults.rb +13 -0
  12. data/lib/less/errors.rb +44 -0
  13. data/lib/less/java_script/rhino_context.rb +100 -0
  14. data/lib/less/java_script/v8_context.rb +105 -0
  15. data/lib/less/java_script.rb +34 -0
  16. data/lib/less/js/.gitattributes +10 -0
  17. data/lib/less/js/.gitignore +24 -0
  18. data/lib/less/js/.jshintrc +11 -0
  19. data/lib/less/js/.npmignore +1 -0
  20. data/lib/less/js/.travis.yml +8 -0
  21. data/lib/less/js/CHANGELOG.md +299 -0
  22. data/lib/less/js/CONTRIBUTING.md +50 -0
  23. data/lib/less/js/Gruntfile.js +298 -0
  24. data/lib/less/js/README.md +43 -12
  25. data/lib/less/js/benchmark/benchmark.less +205 -205
  26. data/lib/less/js/benchmark/less-benchmark.js +11 -14
  27. data/lib/less/js/bin/lessc +350 -43
  28. data/lib/less/js/bower.json +18 -0
  29. data/lib/less/js/build/README.md +51 -0
  30. data/lib/less/js/build/amd.js +6 -0
  31. data/lib/less/js/build/browser-header.js +4 -0
  32. data/lib/less/js/build/build.yml +162 -0
  33. data/lib/less/js/build/require-rhino.js +12 -0
  34. data/lib/less/js/build/rhino-header.js +4 -0
  35. data/lib/less/js/build/rhino-modules.js +131 -0
  36. data/lib/less/js/build/tasks/.gitkeep +1 -0
  37. data/lib/less/js/build.gradle +347 -0
  38. data/lib/less/js/dist/{less-1.0.44.js → less-1.1.4.js} +159 -45
  39. data/lib/less/js/dist/less-1.1.4.min.js +16 -0
  40. data/lib/less/js/dist/less-1.1.5.js +2805 -0
  41. data/lib/less/js/dist/less-1.1.5.min.js +9 -0
  42. data/lib/less/js/dist/less-1.1.6.js +3004 -0
  43. data/lib/less/js/dist/less-1.1.6.min.js +9 -0
  44. data/lib/less/js/dist/less-1.2.0.js +3293 -0
  45. data/lib/less/js/dist/less-1.2.0.min.js +9 -0
  46. data/lib/less/js/dist/less-1.2.1.js +3318 -0
  47. data/lib/less/js/dist/less-1.2.1.min.js +9 -0
  48. data/lib/less/js/dist/less-1.2.2.js +3337 -0
  49. data/lib/less/js/dist/less-1.2.2.min.js +9 -0
  50. data/lib/less/js/dist/less-1.3.0.js +3478 -0
  51. data/lib/less/js/dist/less-1.3.0.min.js +9 -0
  52. data/lib/less/js/dist/less-1.3.1.js +4011 -0
  53. data/lib/less/js/dist/less-1.3.1.min.js +9 -0
  54. data/lib/less/js/dist/less-1.3.2.js +4401 -0
  55. data/lib/less/js/dist/less-1.3.2.min.js +9 -0
  56. data/lib/less/js/dist/less-1.3.3.js +4413 -0
  57. data/lib/less/js/dist/less-1.3.3.min.js +9 -0
  58. data/lib/less/js/dist/less-1.4.0-beta.js +5830 -0
  59. data/lib/less/js/dist/less-1.4.0-beta.min.js +11 -0
  60. data/lib/less/js/dist/less-1.4.0.js +5830 -0
  61. data/lib/less/js/dist/less-1.4.0.min.js +11 -0
  62. data/lib/less/js/dist/less-1.4.1.js +5837 -0
  63. data/lib/less/js/dist/less-1.4.1.min.js +11 -0
  64. data/lib/less/js/dist/less-1.4.2.js +5837 -0
  65. data/lib/less/js/dist/less-1.4.2.min.js +11 -0
  66. data/lib/less/js/dist/less-1.5.0.js +6914 -0
  67. data/lib/less/js/dist/less-1.5.0.min.js +13 -0
  68. data/lib/less/js/dist/less-1.5.1.js +6941 -0
  69. data/lib/less/js/dist/less-1.5.1.min.js +13 -0
  70. data/lib/less/js/dist/less-1.6.0.js +7485 -0
  71. data/lib/less/js/dist/less-1.6.0.min.js +16 -0
  72. data/lib/less/js/dist/less-1.6.1.js +7513 -0
  73. data/lib/less/js/dist/less-1.6.1.min.js +16 -0
  74. data/lib/less/js/dist/less-1.6.2.js +7624 -0
  75. data/lib/less/js/dist/less-1.6.2.min.js +16 -0
  76. data/lib/less/js/dist/less-1.6.3.js +7627 -0
  77. data/lib/less/js/dist/less-1.6.3.min.js +16 -0
  78. data/lib/less/js/dist/less-1.7.0.js +7921 -0
  79. data/lib/less/js/dist/less-1.7.0.min.js +16 -0
  80. data/lib/less/js/dist/less-rhino-1.1.3.js +2460 -0
  81. data/lib/less/js/dist/less-rhino-1.1.5.js +2481 -0
  82. data/lib/less/js/dist/less-rhino-1.3.1.js +3725 -0
  83. data/lib/less/js/dist/less-rhino-1.3.2.js +3990 -0
  84. data/lib/less/js/dist/less-rhino-1.3.3.js +4002 -0
  85. data/lib/less/js/dist/less-rhino-1.4.0.js +4273 -0
  86. data/lib/less/js/dist/less-rhino-1.5.1.js +6831 -0
  87. data/lib/less/js/dist/less-rhino-1.6.2.js +9017 -0
  88. data/lib/less/js/dist/less-rhino-1.6.3.js +9020 -0
  89. data/lib/less/js/dist/less-rhino-1.7.0.js +9301 -0
  90. data/lib/less/js/dist/lessc-rhino-1.6.2.js +449 -0
  91. data/lib/less/js/dist/lessc-rhino-1.6.3.js +449 -0
  92. data/lib/less/js/dist/lessc-rhino-1.7.0.js +449 -0
  93. data/lib/less/js/gradle/wrapper/gradle-wrapper.jar +0 -0
  94. data/lib/less/js/gradle/wrapper/gradle-wrapper.properties +6 -0
  95. data/lib/less/js/gradlew +164 -0
  96. data/lib/less/js/gradlew.bat +90 -0
  97. data/lib/less/js/lib/less/browser.js +556 -248
  98. data/lib/less/js/lib/less/colors.js +151 -0
  99. data/lib/less/js/lib/less/encoder.js +4 -0
  100. data/lib/less/js/lib/less/env.js +136 -0
  101. data/lib/less/js/lib/less/extend-visitor.js +416 -0
  102. data/lib/less/js/lib/less/functions.js +622 -28
  103. data/lib/less/js/lib/less/import-visitor.js +142 -0
  104. data/lib/less/js/lib/less/index.js +198 -83
  105. data/lib/less/js/lib/less/join-selector-visitor.js +44 -0
  106. data/lib/less/js/lib/less/lessc_helper.js +82 -0
  107. data/lib/less/js/lib/less/parser.js +1419 -449
  108. data/lib/less/js/lib/less/rhino.js +448 -0
  109. data/lib/less/js/lib/less/source-map-output.js +141 -0
  110. data/lib/less/js/lib/less/to-css-visitor.js +240 -0
  111. data/lib/less/js/lib/less/tree/alpha.js +18 -6
  112. data/lib/less/js/lib/less/tree/anonymous.js +26 -5
  113. data/lib/less/js/lib/less/tree/assignment.js +29 -0
  114. data/lib/less/js/lib/less/tree/call.js +40 -14
  115. data/lib/less/js/lib/less/tree/color.js +122 -31
  116. data/lib/less/js/lib/less/tree/comment.js +19 -5
  117. data/lib/less/js/lib/less/tree/condition.js +49 -0
  118. data/lib/less/js/lib/less/tree/detached-ruleset.js +20 -0
  119. data/lib/less/js/lib/less/tree/dimension.js +304 -14
  120. data/lib/less/js/lib/less/tree/directive.js +57 -21
  121. data/lib/less/js/lib/less/tree/element.js +89 -13
  122. data/lib/less/js/lib/less/tree/expression.js +40 -9
  123. data/lib/less/js/lib/less/tree/extend.js +53 -0
  124. data/lib/less/js/lib/less/tree/import.js +84 -37
  125. data/lib/less/js/lib/less/tree/javascript.js +18 -11
  126. data/lib/less/js/lib/less/tree/keyword.js +19 -4
  127. data/lib/less/js/lib/less/tree/media.js +157 -0
  128. data/lib/less/js/lib/less/tree/mixin.js +261 -52
  129. data/lib/less/js/lib/less/tree/negative.js +24 -0
  130. data/lib/less/js/lib/less/tree/operation.js +39 -14
  131. data/lib/less/js/lib/less/tree/paren.js +23 -0
  132. data/lib/less/js/lib/less/tree/quoted.js +30 -11
  133. data/lib/less/js/lib/less/tree/rule.js +79 -27
  134. data/lib/less/js/lib/less/tree/ruleset-call.js +16 -0
  135. data/lib/less/js/lib/less/tree/ruleset.js +469 -94
  136. data/lib/less/js/lib/less/tree/selector.js +119 -18
  137. data/lib/less/js/lib/less/tree/unicode-descriptor.js +15 -0
  138. data/lib/less/js/lib/less/tree/url.js +44 -16
  139. data/lib/less/js/lib/less/tree/value.js +17 -7
  140. data/lib/less/js/lib/less/tree/variable.js +29 -9
  141. data/lib/less/js/lib/less/tree.js +88 -4
  142. data/lib/less/js/lib/less/visitor.js +146 -0
  143. data/lib/less/js/lib/source-map/source-map-0.1.31.js +1933 -0
  144. data/lib/less/js/lib/source-map/source-map-footer.js +4 -0
  145. data/lib/less/js/lib/source-map/source-map-header.js +3 -0
  146. data/lib/less/js/package.json +86 -11
  147. data/lib/less/js/test/browser/common.js +201 -0
  148. data/lib/less/js/test/browser/css/global-vars/simple.css +3 -0
  149. data/lib/less/js/test/browser/css/modify-vars/simple.css +8 -0
  150. data/lib/less/js/test/browser/css/postProcessor/postProcessor.css +4 -0
  151. data/lib/less/js/test/browser/css/relative-urls/urls.css +35 -0
  152. data/lib/less/js/test/browser/css/rootpath/urls.css +35 -0
  153. data/lib/less/js/test/browser/css/rootpath-relative/urls.css +35 -0
  154. data/lib/less/js/test/browser/css/urls.css +53 -0
  155. data/lib/less/js/test/browser/es5.js +27 -0
  156. data/lib/less/js/test/browser/jasmine-html.js +681 -0
  157. data/lib/less/js/test/browser/jasmine.css +82 -0
  158. data/lib/less/js/test/browser/jasmine.js +2600 -0
  159. data/lib/less/js/test/browser/less/console-errors/test-error.less +3 -0
  160. data/lib/less/js/test/browser/less/console-errors/test-error.txt +2 -0
  161. data/lib/less/js/test/browser/less/global-vars/simple.less +3 -0
  162. data/lib/less/js/test/browser/less/imports/urls.less +4 -0
  163. data/lib/less/js/test/browser/less/imports/urls2.less +4 -0
  164. data/lib/less/js/test/browser/less/modify-vars/imports/simple2.less +4 -0
  165. data/lib/less/js/test/browser/less/modify-vars/simple.less +8 -0
  166. data/lib/less/js/test/browser/less/postProcessor/postProcessor.less +4 -0
  167. data/lib/less/js/test/browser/less/relative-urls/urls.less +33 -0
  168. data/lib/less/js/test/browser/less/rootpath/urls.less +33 -0
  169. data/lib/less/js/test/browser/less/rootpath-relative/urls.less +33 -0
  170. data/lib/less/js/test/browser/less/urls.less +57 -0
  171. data/lib/less/js/test/browser/phantom-runner.js +150 -0
  172. data/lib/less/js/test/browser/runner-browser-options.js +42 -0
  173. data/lib/less/js/test/browser/runner-browser-spec.js +12 -0
  174. data/lib/less/js/test/browser/runner-console-errors.js +5 -0
  175. data/lib/less/js/test/browser/runner-errors-options.js +5 -0
  176. data/lib/less/js/test/browser/runner-errors-spec.js +4 -0
  177. data/lib/less/js/test/browser/runner-global-vars-options.js +4 -0
  178. data/lib/less/js/test/browser/runner-global-vars-spec.js +3 -0
  179. data/lib/less/js/test/browser/runner-legacy-options.js +4 -0
  180. data/lib/less/js/test/browser/runner-legacy-spec.js +3 -0
  181. data/lib/less/js/test/browser/runner-main-options.js +15 -0
  182. data/lib/less/js/test/browser/runner-main-spec.js +3 -0
  183. data/lib/less/js/test/browser/runner-modify-vars-options.js +2 -0
  184. data/lib/less/js/test/browser/runner-modify-vars-spec.js +43 -0
  185. data/lib/less/js/test/browser/runner-no-js-errors-options.js +4 -0
  186. data/lib/less/js/test/browser/runner-no-js-errors-spec.js +4 -0
  187. data/lib/less/js/test/browser/runner-postProcessor-options.js +4 -0
  188. data/lib/less/js/test/browser/runner-postProcessor.js +3 -0
  189. data/lib/less/js/test/browser/runner-production-options.js +3 -0
  190. data/lib/less/js/test/browser/runner-production-spec.js +5 -0
  191. data/lib/less/js/test/browser/runner-relative-urls-options.js +3 -0
  192. data/lib/less/js/test/browser/runner-relative-urls-spec.js +3 -0
  193. data/lib/less/js/test/browser/runner-rootpath-options.js +3 -0
  194. data/lib/less/js/test/browser/runner-rootpath-relative-options.js +4 -0
  195. data/lib/less/js/test/browser/runner-rootpath-relative-spec.js +3 -0
  196. data/lib/less/js/test/browser/runner-rootpath-spec.js +3 -0
  197. data/lib/less/js/test/browser/test-runner-template.tmpl +47 -0
  198. data/lib/less/js/test/css/charsets.css +1 -0
  199. data/lib/less/js/test/css/colors.css +45 -0
  200. data/lib/less/js/test/css/comments.css +24 -7
  201. data/lib/less/js/test/css/compression/compression.css +3 -0
  202. data/lib/less/js/test/css/css-3.css +91 -4
  203. data/lib/less/js/test/css/css-escapes.css +5 -1
  204. data/lib/less/js/test/css/css-guards.css +37 -0
  205. data/lib/less/js/test/css/css.css +29 -16
  206. data/lib/less/js/test/css/debug/linenumbers-all.css +49 -0
  207. data/lib/less/js/test/css/debug/linenumbers-comments.css +40 -0
  208. data/lib/less/js/test/css/debug/linenumbers-mediaquery.css +40 -0
  209. data/lib/less/js/test/css/detached-rulesets.css +71 -0
  210. data/lib/less/js/test/css/empty.css +0 -0
  211. data/lib/less/js/test/css/extend-chaining.css +81 -0
  212. data/lib/less/js/test/css/extend-clearfix.css +19 -0
  213. data/lib/less/js/test/css/extend-exact.css +37 -0
  214. data/lib/less/js/test/css/extend-media.css +24 -0
  215. data/lib/less/js/test/css/extend-nest.css +57 -0
  216. data/lib/less/js/test/css/extend-selector.css +80 -0
  217. data/lib/less/js/test/css/extend.css +76 -0
  218. data/lib/less/js/test/css/extract-and-length.css +133 -0
  219. data/lib/less/js/test/css/functions.css +128 -0
  220. data/lib/less/js/test/css/globalVars/extended.css +12 -0
  221. data/lib/less/js/test/css/globalVars/simple.css +6 -0
  222. data/lib/less/js/test/css/ie-filters.css +9 -0
  223. data/lib/less/js/test/css/import-inline.css +5 -0
  224. data/lib/less/js/test/css/import-interpolation.css +6 -0
  225. data/lib/less/js/test/css/import-once.css +15 -0
  226. data/lib/less/js/test/css/import-reference.css +68 -0
  227. data/lib/less/js/test/css/import.css +30 -8
  228. data/lib/less/js/test/css/javascript.css +3 -2
  229. data/lib/less/js/test/css/legacy/legacy.css +7 -0
  230. data/lib/less/js/test/css/media.css +200 -2
  231. data/lib/less/js/test/css/merge.css +34 -0
  232. data/lib/less/js/test/css/mixins-args.css +58 -6
  233. data/lib/less/js/test/css/mixins-guards-default-func.css +129 -0
  234. data/lib/less/js/test/css/mixins-guards.css +82 -0
  235. data/lib/less/js/test/css/mixins-important.css +45 -0
  236. data/lib/less/js/test/css/mixins-interpolated.css +39 -0
  237. data/lib/less/js/test/css/mixins-named-args.css +27 -0
  238. data/lib/less/js/test/css/mixins-pattern.css +8 -6
  239. data/lib/less/js/test/css/mixins.css +91 -0
  240. data/lib/less/js/test/css/modifyVars/extended.css +9 -0
  241. data/lib/less/js/test/css/no-output.css +0 -0
  242. data/lib/less/js/test/css/operations.css +3 -0
  243. data/lib/less/js/test/css/parens.css +22 -6
  244. data/lib/less/js/test/css/property-name-interp.css +20 -0
  245. data/lib/less/js/test/css/rulesets.css +6 -2
  246. data/lib/less/js/test/css/scope.css +29 -6
  247. data/lib/less/js/test/css/selectors.css +122 -1
  248. data/lib/less/js/test/css/static-urls/urls.css +45 -0
  249. data/lib/less/js/test/css/strings.css +10 -5
  250. data/lib/less/js/test/css/url-args/urls.css +56 -0
  251. data/lib/less/js/test/css/urls.css +71 -0
  252. data/lib/less/js/test/css/variables-in-at-rules.css +18 -0
  253. data/lib/less/js/test/css/variables.css +23 -2
  254. data/lib/less/js/test/css/whitespace.css +9 -3
  255. data/lib/less/js/test/data/data-uri-fail.png +0 -0
  256. data/lib/less/js/test/data/image.jpg +1 -0
  257. data/lib/less/js/test/data/page.html +1 -0
  258. data/lib/less/js/test/index.js +45 -0
  259. data/lib/less/js/test/less/charsets.less +3 -0
  260. data/lib/less/js/test/less/colors.less +56 -4
  261. data/lib/less/js/test/less/comments.less +28 -8
  262. data/lib/less/js/test/less/compression/compression.less +36 -0
  263. data/lib/less/js/test/less/css-3.less +80 -6
  264. data/lib/less/js/test/less/css-escapes.less +6 -1
  265. data/lib/less/js/test/less/css-guards.less +102 -0
  266. data/lib/less/js/test/less/css.less +25 -13
  267. data/lib/less/js/test/less/debug/import/test.less +25 -0
  268. data/lib/less/js/test/less/debug/linenumbers.less +33 -0
  269. data/lib/less/js/test/less/detached-rulesets.less +103 -0
  270. data/lib/less/js/test/less/empty.less +0 -0
  271. data/lib/less/js/test/less/errors/add-mixed-units.less +3 -0
  272. data/lib/less/js/test/less/errors/add-mixed-units.txt +4 -0
  273. data/lib/less/js/test/less/errors/add-mixed-units2.less +3 -0
  274. data/lib/less/js/test/less/errors/add-mixed-units2.txt +4 -0
  275. data/lib/less/js/test/less/errors/at-rules-undefined-var.less +4 -0
  276. data/lib/less/js/test/less/errors/at-rules-undefined-var.txt +4 -0
  277. data/lib/less/js/test/less/errors/bad-variable-declaration1.less +1 -0
  278. data/lib/less/js/test/less/errors/bad-variable-declaration1.txt +2 -0
  279. data/lib/less/js/test/less/errors/color-func-invalid-color.less +3 -0
  280. data/lib/less/js/test/less/errors/color-func-invalid-color.txt +4 -0
  281. data/lib/less/js/test/less/errors/comment-in-selector.less +1 -0
  282. data/lib/less/js/test/less/errors/comment-in-selector.txt +2 -0
  283. data/lib/less/js/test/less/errors/css-guard-default-func.less +4 -0
  284. data/lib/less/js/test/less/errors/css-guard-default-func.txt +4 -0
  285. data/lib/less/js/test/less/errors/detached-ruleset-1.less +6 -0
  286. data/lib/less/js/test/less/errors/detached-ruleset-1.txt +4 -0
  287. data/lib/less/js/test/less/errors/detached-ruleset-2.less +6 -0
  288. data/lib/less/js/test/less/errors/detached-ruleset-2.txt +4 -0
  289. data/lib/less/js/test/less/errors/detached-ruleset-3.less +4 -0
  290. data/lib/less/js/test/less/errors/detached-ruleset-3.txt +4 -0
  291. data/lib/less/js/test/less/errors/detached-ruleset-4.less +5 -0
  292. data/lib/less/js/test/less/errors/detached-ruleset-4.txt +3 -0
  293. data/lib/less/js/test/less/errors/detached-ruleset-5.less +4 -0
  294. data/lib/less/js/test/less/errors/detached-ruleset-5.txt +3 -0
  295. data/lib/less/js/test/less/errors/detached-ruleset-6.less +5 -0
  296. data/lib/less/js/test/less/errors/detached-ruleset-6.txt +4 -0
  297. data/lib/less/js/test/less/errors/divide-mixed-units.less +3 -0
  298. data/lib/less/js/test/less/errors/divide-mixed-units.txt +4 -0
  299. data/lib/less/js/test/less/errors/extend-no-selector.less +3 -0
  300. data/lib/less/js/test/less/errors/extend-no-selector.txt +3 -0
  301. data/lib/less/js/test/less/errors/extend-not-at-end.less +3 -0
  302. data/lib/less/js/test/less/errors/extend-not-at-end.txt +3 -0
  303. data/lib/less/js/test/less/errors/import-missing.less +6 -0
  304. data/lib/less/js/test/less/errors/import-missing.txt +3 -0
  305. data/lib/less/js/test/less/errors/import-no-semi.less +1 -0
  306. data/lib/less/js/test/less/errors/import-no-semi.txt +2 -0
  307. data/lib/less/js/test/less/errors/import-subfolder1.less +1 -0
  308. data/lib/less/js/test/less/errors/import-subfolder1.txt +3 -0
  309. data/lib/less/js/test/less/errors/import-subfolder2.less +1 -0
  310. data/lib/less/js/test/less/errors/import-subfolder2.txt +4 -0
  311. data/lib/less/js/test/less/errors/imports/import-subfolder1.less +1 -0
  312. data/lib/less/js/test/less/errors/imports/import-subfolder2.less +1 -0
  313. data/lib/less/js/test/less/errors/imports/import-test.less +4 -0
  314. data/lib/less/js/test/less/errors/imports/subfolder/mixin-not-defined.less +1 -0
  315. data/lib/less/js/test/less/errors/imports/subfolder/parse-error-curly-bracket.less +1 -0
  316. data/lib/less/js/test/less/errors/javascript-error.less +3 -0
  317. data/lib/less/js/test/less/errors/javascript-error.txt +4 -0
  318. data/lib/less/js/test/less/errors/javascript-undefined-var.less +3 -0
  319. data/lib/less/js/test/less/errors/javascript-undefined-var.txt +4 -0
  320. data/lib/less/js/test/less/errors/mixed-mixin-definition-args-1.less +6 -0
  321. data/lib/less/js/test/less/errors/mixed-mixin-definition-args-1.txt +4 -0
  322. data/lib/less/js/test/less/errors/mixed-mixin-definition-args-2.less +6 -0
  323. data/lib/less/js/test/less/errors/mixed-mixin-definition-args-2.txt +4 -0
  324. data/lib/less/js/test/less/errors/mixin-not-defined.less +11 -0
  325. data/lib/less/js/test/less/errors/mixin-not-defined.txt +3 -0
  326. data/lib/less/js/test/less/errors/mixin-not-matched.less +6 -0
  327. data/lib/less/js/test/less/errors/mixin-not-matched.txt +3 -0
  328. data/lib/less/js/test/less/errors/mixin-not-matched2.less +6 -0
  329. data/lib/less/js/test/less/errors/mixin-not-matched2.txt +3 -0
  330. data/lib/less/js/test/less/errors/mixin-not-visible-in-scope-1.less +9 -0
  331. data/lib/less/js/test/less/errors/mixin-not-visible-in-scope-1.txt +4 -0
  332. data/lib/less/js/test/less/errors/mixins-guards-default-func-1.less +9 -0
  333. data/lib/less/js/test/less/errors/mixins-guards-default-func-1.txt +4 -0
  334. data/lib/less/js/test/less/errors/mixins-guards-default-func-2.less +9 -0
  335. data/lib/less/js/test/less/errors/mixins-guards-default-func-2.txt +4 -0
  336. data/lib/less/js/test/less/errors/mixins-guards-default-func-3.less +9 -0
  337. data/lib/less/js/test/less/errors/mixins-guards-default-func-3.txt +4 -0
  338. data/lib/less/js/test/less/errors/multiple-guards-on-css-selectors.less +4 -0
  339. data/lib/less/js/test/less/errors/multiple-guards-on-css-selectors.txt +4 -0
  340. data/lib/less/js/test/less/errors/multiple-guards-on-css-selectors2.less +4 -0
  341. data/lib/less/js/test/less/errors/multiple-guards-on-css-selectors2.txt +4 -0
  342. data/lib/less/js/test/less/errors/multiply-mixed-units.less +7 -0
  343. data/lib/less/js/test/less/errors/multiply-mixed-units.txt +4 -0
  344. data/lib/less/js/test/less/errors/parens-error-1.less +3 -0
  345. data/lib/less/js/test/less/errors/parens-error-1.txt +4 -0
  346. data/lib/less/js/test/less/errors/parens-error-2.less +3 -0
  347. data/lib/less/js/test/less/errors/parens-error-2.txt +4 -0
  348. data/lib/less/js/test/less/errors/parens-error-3.less +3 -0
  349. data/lib/less/js/test/less/errors/parens-error-3.txt +4 -0
  350. data/lib/less/js/test/less/errors/parse-error-curly-bracket.less +4 -0
  351. data/lib/less/js/test/less/errors/parse-error-curly-bracket.txt +4 -0
  352. data/lib/less/js/test/less/errors/parse-error-extra-parens.less +5 -0
  353. data/lib/less/js/test/less/errors/parse-error-extra-parens.txt +3 -0
  354. data/lib/less/js/test/less/errors/parse-error-missing-bracket.less +2 -0
  355. data/lib/less/js/test/less/errors/parse-error-missing-bracket.txt +3 -0
  356. data/lib/less/js/test/less/errors/parse-error-missing-parens.less +5 -0
  357. data/lib/less/js/test/less/errors/parse-error-missing-parens.txt +3 -0
  358. data/lib/less/js/test/less/errors/parse-error-with-import.less +13 -0
  359. data/lib/less/js/test/less/errors/parse-error-with-import.txt +4 -0
  360. data/lib/less/js/test/less/errors/percentage-missing-space.less +3 -0
  361. data/lib/less/js/test/less/errors/percentage-missing-space.txt +4 -0
  362. data/lib/less/js/test/less/errors/property-asterisk-only-name.less +3 -0
  363. data/lib/less/js/test/less/errors/property-asterisk-only-name.txt +4 -0
  364. data/lib/less/js/test/less/errors/property-ie5-hack.less +3 -0
  365. data/lib/less/js/test/less/errors/property-ie5-hack.txt +4 -0
  366. data/lib/less/js/test/less/errors/property-in-root.less +4 -0
  367. data/lib/less/js/test/less/errors/property-in-root.txt +4 -0
  368. data/lib/less/js/test/less/errors/property-in-root2.less +1 -0
  369. data/lib/less/js/test/less/errors/property-in-root2.txt +4 -0
  370. data/lib/less/js/test/less/errors/property-in-root3.less +4 -0
  371. data/lib/less/js/test/less/errors/property-in-root3.txt +3 -0
  372. data/lib/less/js/test/less/errors/property-interp-not-defined.less +1 -0
  373. data/lib/less/js/test/less/errors/property-interp-not-defined.txt +2 -0
  374. data/lib/less/js/test/less/errors/recursive-variable.less +1 -0
  375. data/lib/less/js/test/less/errors/recursive-variable.txt +2 -0
  376. data/lib/less/js/test/less/errors/svg-gradient1.less +3 -0
  377. data/lib/less/js/test/less/errors/svg-gradient1.txt +4 -0
  378. data/lib/less/js/test/less/errors/svg-gradient2.less +3 -0
  379. data/lib/less/js/test/less/errors/svg-gradient2.txt +4 -0
  380. data/lib/less/js/test/less/errors/svg-gradient3.less +3 -0
  381. data/lib/less/js/test/less/errors/svg-gradient3.txt +4 -0
  382. data/lib/less/js/test/less/errors/unit-function.less +3 -0
  383. data/lib/less/js/test/less/errors/unit-function.txt +4 -0
  384. data/lib/less/js/test/less/extend-chaining.less +91 -0
  385. data/lib/less/js/test/less/extend-clearfix.less +19 -0
  386. data/lib/less/js/test/less/extend-exact.less +46 -0
  387. data/lib/less/js/test/less/extend-media.less +24 -0
  388. data/lib/less/js/test/less/extend-nest.less +65 -0
  389. data/lib/less/js/test/less/extend-selector.less +99 -0
  390. data/lib/less/js/test/less/extend.less +81 -0
  391. data/lib/less/js/test/less/extract-and-length.less +133 -0
  392. data/lib/less/js/test/less/functions.less +142 -4
  393. data/lib/less/js/test/less/globalVars/extended.json +5 -0
  394. data/lib/less/js/test/less/globalVars/extended.less +10 -0
  395. data/lib/less/js/test/less/globalVars/simple.json +3 -0
  396. data/lib/less/js/test/less/globalVars/simple.less +3 -0
  397. data/lib/less/js/test/less/ie-filters.less +15 -0
  398. data/lib/less/js/test/less/import/deeper/import-once-test-a.less +1 -0
  399. data/lib/less/js/test/less/import/import-and-relative-paths-test.less +17 -0
  400. data/lib/less/js/test/less/import/import-charset-test.less +1 -0
  401. data/lib/less/js/test/less/import/import-interpolation.less +1 -0
  402. data/lib/less/js/test/less/import/import-interpolation2.less +5 -0
  403. data/lib/less/js/test/less/import/import-once-test-c.less +6 -0
  404. data/lib/less/js/test/less/import/import-reference.less +51 -0
  405. data/lib/less/js/test/less/import/import-test-a.less +1 -0
  406. data/lib/less/js/test/less/import/import-test-c.less +0 -1
  407. data/lib/less/js/test/less/import/import-test-e.less +2 -0
  408. data/lib/less/js/test/less/import/import-test-f.less +5 -0
  409. data/lib/less/js/test/less/import/imports/font.less +8 -0
  410. data/lib/less/js/test/less/import/imports/logo.less +5 -0
  411. data/lib/less/js/test/less/import/invalid-css.less +1 -0
  412. data/lib/less/js/test/less/import/urls.less +1 -0
  413. data/lib/less/js/test/less/import-inline.less +2 -0
  414. data/lib/less/js/test/less/import-interpolation.less +8 -0
  415. data/lib/less/js/test/less/import-once.less +6 -0
  416. data/lib/less/js/test/less/import-reference.less +21 -0
  417. data/lib/less/js/test/less/import.less +16 -3
  418. data/lib/less/js/test/less/javascript.less +5 -3
  419. data/lib/less/js/test/less/legacy/legacy.less +7 -0
  420. data/lib/less/js/test/less/media.less +212 -3
  421. data/lib/less/js/test/less/merge.less +78 -0
  422. data/lib/less/js/test/less/mixins-args.less +113 -16
  423. data/lib/less/js/test/less/mixins-guards-default-func.less +195 -0
  424. data/lib/less/js/test/less/mixins-guards.less +159 -0
  425. data/lib/less/js/test/less/mixins-important.less +25 -0
  426. data/lib/less/js/test/less/mixins-interpolated.less +69 -0
  427. data/lib/less/js/test/less/mixins-named-args.less +36 -0
  428. data/lib/less/js/test/less/mixins-nested.less +2 -2
  429. data/lib/less/js/test/less/mixins-pattern.less +7 -1
  430. data/lib/less/js/test/less/mixins.less +94 -0
  431. data/lib/less/js/test/less/modifyVars/extended.json +5 -0
  432. data/lib/less/js/test/less/modifyVars/extended.less +11 -0
  433. data/lib/less/js/test/less/no-js-errors/no-js-errors.less +3 -0
  434. data/lib/less/js/test/less/no-js-errors/no-js-errors.txt +4 -0
  435. data/lib/less/js/test/less/no-output.less +2 -0
  436. data/lib/less/js/test/less/operations.less +30 -26
  437. data/lib/less/js/test/less/parens.less +24 -5
  438. data/lib/less/js/test/less/property-name-interp.less +53 -0
  439. data/lib/less/js/test/less/scope.less +73 -1
  440. data/lib/less/js/test/less/selectors.less +132 -0
  441. data/lib/less/js/test/less/sourcemaps/basic.json +3 -0
  442. data/lib/less/js/test/less/sourcemaps/basic.less +27 -0
  443. data/lib/less/js/test/less/sourcemaps/imported.css +7 -0
  444. data/lib/less/js/test/less/static-urls/urls.less +33 -0
  445. data/lib/less/js/test/less/strings.less +9 -1
  446. data/lib/less/js/test/less/url-args/urls.less +63 -0
  447. data/lib/less/js/test/less/urls.less +72 -0
  448. data/lib/less/js/test/less/variables-in-at-rules.less +20 -0
  449. data/lib/less/js/test/less/variables.less +44 -11
  450. data/lib/less/js/test/less/whitespace.less +7 -0
  451. data/lib/less/js/test/less-test.js +244 -60
  452. data/lib/less/js/test/rhino/test-header.js +15 -0
  453. data/lib/less/js/test/sourcemaps/basic.json +1 -0
  454. data/lib/less/js/test/sourcemaps/index.html +17 -0
  455. data/lib/less/loader.rb +208 -42
  456. data/lib/less/parser.rb +91 -30
  457. data/lib/less/version.rb +2 -2
  458. data/lib/less.rb +23 -8
  459. data/spec/less/faulty/faulty.less +3 -0
  460. data/spec/less/loader_spec.rb +45 -0
  461. data/spec/less/parser_spec.rb +141 -4
  462. data/spec/less/some/some.css +0 -0
  463. data/spec/less/some/some.less +4 -0
  464. data/spec/spec_helper.rb +4 -2
  465. metadata +418 -76
  466. data/lib/less/js/Makefile +0 -56
  467. data/lib/less/js/build/ecma-5.js +0 -120
  468. data/lib/less/js/build/header.js +0 -7
@@ -1,8 +1,8 @@
1
1
  //
2
- // LESS - Leaner CSS v1.0.44
2
+ // LESS - Leaner CSS v1.1.4
3
3
  // http://lesscss.org
4
4
  //
5
- // Copyright (c) 2010, Alexis Sellier
5
+ // Copyright (c) 2009-2011, Alexis Sellier
6
6
  // Licensed under the Apache 2.0 License.
7
7
  //
8
8
  (function (window, undefined) {
@@ -592,11 +592,15 @@ less.Parser = function Parser(env) {
592
592
  // "milky way" 'he\'s the one!'
593
593
  //
594
594
  quoted: function () {
595
- var str;
596
- if (input.charAt(i) !== '"' && input.charAt(i) !== "'") return;
595
+ var str, j = i, e;
596
+
597
+ if (input.charAt(j) === '~') { j++, e = true } // Escaped strings
598
+ if (input.charAt(j) !== '"' && input.charAt(j) !== "'") return;
599
+
600
+ e && $('~');
597
601
 
598
602
  if (str = $(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/)) {
599
- return new(tree.Quoted)(str[0], str[1] || str[2]);
603
+ return new(tree.Quoted)(str[0], str[1] || str[2], e);
600
604
  }
601
605
  },
602
606
 
@@ -621,7 +625,7 @@ less.Parser = function Parser(env) {
621
625
  // The arguments are parsed with the `entities.arguments` parser.
622
626
  //
623
627
  call: function () {
624
- var name, args;
628
+ var name, args, index = i;
625
629
 
626
630
  if (! (name = /^([\w-]+|%)\(/.exec(chunks[j]))) return;
627
631
 
@@ -638,7 +642,7 @@ less.Parser = function Parser(env) {
638
642
 
639
643
  if (! $(')')) return;
640
644
 
641
- if (name) { return new(tree.Call)(name, args) }
645
+ if (name) { return new(tree.Call)(name, args, index) }
642
646
  },
643
647
  arguments: function () {
644
648
  var args = [], arg;
@@ -667,7 +671,7 @@ less.Parser = function Parser(env) {
667
671
 
668
672
  if (input.charAt(i) !== 'u' || !$(/^url\(/)) return;
669
673
  value = $(this.entities.quoted) || $(this.entities.variable) ||
670
- $(this.entities.dataURI) || $(/^[-\w%@$\/.&=:;#+?]+/) || "";
674
+ $(this.entities.dataURI) || $(/^[-\w%@$\/.&=:;#+?~]+/) || "";
671
675
  if (! $(')')) throw new(Error)("missing closing ) for url()");
672
676
 
673
677
  return new(tree.URL)((value.value || value.data || value instanceof tree.Variable)
@@ -699,7 +703,7 @@ less.Parser = function Parser(env) {
699
703
  variable: function () {
700
704
  var name, index = i;
701
705
 
702
- if (input.charAt(i) === '@' && (name = $(/^@[\w-]+/))) {
706
+ if (input.charAt(i) === '@' && (name = $(/^@@?[\w-]+/))) {
703
707
  return new(tree.Variable)(name, index);
704
708
  }
705
709
  },
@@ -739,12 +743,15 @@ less.Parser = function Parser(env) {
739
743
  // `window.location.href`
740
744
  //
741
745
  javascript: function () {
742
- var str;
746
+ var str, j = i, e;
743
747
 
744
- if (input.charAt(i) !== '`') { return }
748
+ if (input.charAt(j) === '~') { j++, e = true } // Escaped strings
749
+ if (input.charAt(j) !== '`') { return }
750
+
751
+ e && $('~');
745
752
 
746
753
  if (str = $(/^`([^`]*)`/)) {
747
- return new(tree.JavaScript)(str[1], i);
754
+ return new(tree.JavaScript)(str[1], i, e);
748
755
  }
749
756
  }
750
757
  },
@@ -892,7 +899,7 @@ less.Parser = function Parser(env) {
892
899
  alpha: function () {
893
900
  var value;
894
901
 
895
- if (! $(/^opacity=/i)) return;
902
+ if (! $(/^\(opacity=/i)) return;
896
903
  if (value = $(/^\d+/) || $(this.entities.variable)) {
897
904
  if (! $(')')) throw new(Error)("missing closing ) for alpha()");
898
905
  return new(tree.Alpha)(value);
@@ -915,9 +922,13 @@ less.Parser = function Parser(env) {
915
922
  var e, t, c;
916
923
 
917
924
  c = $(this.combinator);
918
- e = $(/^(?:[.#]?|:*)(?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/) || $('*') || $(this.attribute) || $(/^\([^)@]+\)/);
925
+ e = $(/^(?:[.#]?|:*)(?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/) || $('*') || $(this.attribute) || $(/^\([^)@]+\)/) || $(/^(?:\d*\.)?\d+%/);
919
926
 
920
927
  if (e) { return new(tree.Element)(c, e) }
928
+
929
+ if (c.value && c.value[0] === '&') {
930
+ return new(tree.Element)(c, null);
931
+ }
921
932
  },
922
933
 
923
934
  //
@@ -932,10 +943,18 @@ less.Parser = function Parser(env) {
932
943
  combinator: function () {
933
944
  var match, c = input.charAt(i);
934
945
 
935
- if (c === '>' || c === '&' || c === '+' || c === '~') {
946
+ if (c === '>' || c === '+' || c === '~') {
936
947
  i++;
937
948
  while (input.charAt(i) === ' ') { i++ }
938
949
  return new(tree.Combinator)(c);
950
+ } else if (c === '&') {
951
+ match = '&';
952
+ i++;
953
+ if(input.charAt(i) === ' ') {
954
+ match = '& ';
955
+ }
956
+ while (input.charAt(i) === ' ') { i++ }
957
+ return new(tree.Combinator)(match);
939
958
  } else if (c === ':' && input.charAt(i + 1) === ':') {
940
959
  i += 2;
941
960
  while (input.charAt(i) === ' ') { i++ }
@@ -1005,7 +1024,7 @@ less.Parser = function Parser(env) {
1005
1024
  var selectors = [], s, rules, match;
1006
1025
  save();
1007
1026
 
1008
- if (match = /^([.#: \w-]+)[\s\n]*\{/.exec(chunks[j])) {
1027
+ if (match = /^([.#:% \w-]+)[\s\n]*\{/.exec(chunks[j])) {
1009
1028
  i += match[0].length - 1;
1010
1029
  selectors = [new(tree.Selector)([new(tree.Element)(null, match[1])])];
1011
1030
  } else {
@@ -1082,7 +1101,7 @@ less.Parser = function Parser(env) {
1082
1101
 
1083
1102
  if (value = $(this['import'])) {
1084
1103
  return value;
1085
- } else if (name = $(/^@media|@page|@-[-a-z]+/)) {
1104
+ } else if (name = $(/^@media|@page/) || $(/^@(?:-webkit-)?keyframes/)) {
1086
1105
  types = ($(/^[^{]+/) || '').trim();
1087
1106
  if (rules = $(this.block)) {
1088
1107
  return new(tree.Directive)(name + " " + types, rules);
@@ -1408,7 +1427,10 @@ tree.Alpha.prototype = {
1408
1427
  return "alpha(opacity=" +
1409
1428
  (this.value.toCSS ? this.value.toCSS() : this.value) + ")";
1410
1429
  },
1411
- eval: function () { return this }
1430
+ eval: function (env) {
1431
+ if (this.value.eval) { this.value = this.value.eval(env) }
1432
+ return this;
1433
+ }
1412
1434
  };
1413
1435
 
1414
1436
  })(require('less/tree'));
@@ -1430,9 +1452,10 @@ tree.Anonymous.prototype = {
1430
1452
  //
1431
1453
  // A function call node.
1432
1454
  //
1433
- tree.Call = function (name, args) {
1455
+ tree.Call = function (name, args, index) {
1434
1456
  this.name = name;
1435
1457
  this.args = args;
1458
+ this.index = index;
1436
1459
  };
1437
1460
  tree.Call.prototype = {
1438
1461
  //
@@ -1451,7 +1474,12 @@ tree.Call.prototype = {
1451
1474
  var args = this.args.map(function (a) { return a.eval(env) });
1452
1475
 
1453
1476
  if (this.name in tree.functions) { // 1.
1454
- return tree.functions[this.name].apply(tree.functions, args);
1477
+ try {
1478
+ return tree.functions[this.name].apply(tree.functions, args);
1479
+ } catch (e) {
1480
+ throw { message: "error evaluating function `" + this.name + "`",
1481
+ index: this.index };
1482
+ }
1455
1483
  } else { // 2.
1456
1484
  return new(tree.Anonymous)(this.name +
1457
1485
  "(" + args.map(function (a) { return a.toCSS() }).join(', ') + ")");
@@ -1648,7 +1676,7 @@ tree.Directive.prototype = {
1648
1676
  tree.Element = function (combinator, value) {
1649
1677
  this.combinator = combinator instanceof tree.Combinator ?
1650
1678
  combinator : new(tree.Combinator)(combinator);
1651
- this.value = value.trim();
1679
+ this.value = value ? value.trim() : "";
1652
1680
  };
1653
1681
  tree.Element.prototype.toCSS = function (env) {
1654
1682
  return this.combinator.toCSS(env || {}) + this.value;
@@ -1657,6 +1685,8 @@ tree.Element.prototype.toCSS = function (env) {
1657
1685
  tree.Combinator = function (value) {
1658
1686
  if (value === ' ') {
1659
1687
  this.value = ' ';
1688
+ } else if (value === '& ') {
1689
+ this.value = '& ';
1660
1690
  } else {
1661
1691
  this.value = value ? value.trim() : "";
1662
1692
  }
@@ -1666,6 +1696,7 @@ tree.Combinator.prototype.toCSS = function (env) {
1666
1696
  '' : '',
1667
1697
  ' ' : ' ',
1668
1698
  '&' : '',
1699
+ '& ' : ' ',
1669
1700
  ':' : ' :',
1670
1701
  '::': '::',
1671
1702
  '+' : env.compress ? '+' : ' + ',
@@ -1684,8 +1715,10 @@ tree.Expression.prototype = {
1684
1715
  return new(tree.Expression)(this.value.map(function (e) {
1685
1716
  return e.eval(env);
1686
1717
  }));
1687
- } else {
1718
+ } else if (this.value.length === 1) {
1688
1719
  return this.value[0].eval(env);
1720
+ } else {
1721
+ return this;
1689
1722
  }
1690
1723
  },
1691
1724
  toCSS: function (env) {
@@ -1775,19 +1808,28 @@ tree.Import.prototype = {
1775
1808
  })(require('less/tree'));
1776
1809
  (function (tree) {
1777
1810
 
1778
- tree.JavaScript = function (string, index) {
1811
+ tree.JavaScript = function (string, index, escaped) {
1812
+ this.escaped = escaped;
1779
1813
  this.expression = string;
1780
1814
  this.index = index;
1781
1815
  };
1782
1816
  tree.JavaScript.prototype = {
1783
- toCSS: function () {
1784
- return JSON.stringify(this.evaluated);
1785
- },
1786
1817
  eval: function (env) {
1787
1818
  var result,
1788
- expression = new(Function)('return (' + this.expression + ')'),
1819
+ that = this,
1789
1820
  context = {};
1790
1821
 
1822
+ var expression = this.expression.replace(/@\{([\w-]+)\}/g, function (_, name) {
1823
+ return tree.jsify(new(tree.Variable)('@' + name, that.index).eval(env));
1824
+ });
1825
+
1826
+ try {
1827
+ expression = new(Function)('return (' + expression + ')');
1828
+ } catch (e) {
1829
+ throw { message: "JavaScript evaluation error: `" + expression + "`" ,
1830
+ index: this.index };
1831
+ }
1832
+
1791
1833
  for (var k in env.frames[0].variables()) {
1792
1834
  context[k.slice(1)] = {
1793
1835
  value: env.frames[0].variables()[k].value,
@@ -1798,12 +1840,18 @@ tree.JavaScript.prototype = {
1798
1840
  }
1799
1841
 
1800
1842
  try {
1801
- this.evaluated = expression.call(context);
1843
+ result = expression.call(context);
1802
1844
  } catch (e) {
1803
1845
  throw { message: "JavaScript evaluation error: '" + e.name + ': ' + e.message + "'" ,
1804
1846
  index: this.index };
1805
1847
  }
1806
- return this;
1848
+ if (typeof(result) === 'string') {
1849
+ return new(tree.Quoted)('"' + result + '"', result, this.escaped, this.index);
1850
+ } else if (Array.isArray(result)) {
1851
+ return new(tree.Anonymous)(result.join(', '));
1852
+ } else {
1853
+ return new(tree.Anonymous)(result);
1854
+ }
1807
1855
  }
1808
1856
  };
1809
1857
 
@@ -1828,12 +1876,13 @@ tree.mixin.Call = function (elements, args, index) {
1828
1876
  };
1829
1877
  tree.mixin.Call.prototype = {
1830
1878
  eval: function (env) {
1831
- var mixins, rules = [], match = false;
1879
+ var mixins, args, rules = [], match = false;
1832
1880
 
1833
1881
  for (var i = 0; i < env.frames.length; i++) {
1834
1882
  if ((mixins = env.frames[i].find(this.selector)).length > 0) {
1883
+ args = this.arguments && this.arguments.map(function (a) { return a.eval(env) });
1835
1884
  for (var m = 0; m < mixins.length; m++) {
1836
- if (mixins[m].match(this.arguments, env)) {
1885
+ if (mixins[m].match(args, env)) {
1837
1886
  try {
1838
1887
  Array.prototype.push.apply(
1839
1888
  rules, mixins[m].eval(env, this.arguments).rules);
@@ -1882,7 +1931,7 @@ tree.mixin.Definition.prototype = {
1882
1931
  rulesets: function () { return this.parent.rulesets.apply(this) },
1883
1932
 
1884
1933
  eval: function (env, args) {
1885
- var frame = new(tree.Ruleset)(null, []), context;
1934
+ var frame = new(tree.Ruleset)(null, []), context, _arguments = [];
1886
1935
 
1887
1936
  for (var i = 0, val; i < this.params.length; i++) {
1888
1937
  if (this.params[i].name) {
@@ -1894,7 +1943,10 @@ tree.mixin.Definition.prototype = {
1894
1943
  }
1895
1944
  }
1896
1945
  }
1897
- frame.rules.unshift(new(tree.Rule)('@arguments', new(tree.Expression)(args)));
1946
+ for (var i = 0; i < Math.max(this.params.length, args && args.length); i++) {
1947
+ _arguments.push(args[i] || this.params[i].value);
1948
+ }
1949
+ frame.rules.unshift(new(tree.Rule)('@arguments', new(tree.Expression)(_arguments).eval(env)));
1898
1950
 
1899
1951
  return new(tree.Ruleset)(null, this.rules.slice(0)).eval({
1900
1952
  frames: [this, frame].concat(this.frames, env.frames)
@@ -1954,16 +2006,29 @@ tree.operate = function (op, a, b) {
1954
2006
  })(require('less/tree'));
1955
2007
  (function (tree) {
1956
2008
 
1957
- tree.Quoted = function (str, content) {
2009
+ tree.Quoted = function (str, content, escaped, i) {
2010
+ this.escaped = escaped;
1958
2011
  this.value = content || '';
1959
2012
  this.quote = str.charAt(0);
2013
+ this.index = i;
1960
2014
  };
1961
2015
  tree.Quoted.prototype = {
1962
2016
  toCSS: function () {
1963
- return this.quote + this.value + this.quote;
2017
+ if (this.escaped) {
2018
+ return this.value;
2019
+ } else {
2020
+ return this.quote + this.value + this.quote;
2021
+ }
1964
2022
  },
1965
- eval: function () {
1966
- return this;
2023
+ eval: function (env) {
2024
+ var that = this;
2025
+ var value = this.value.replace(/`([^`]+)`/g, function (_, exp) {
2026
+ return new(tree.JavaScript)(exp, that.index, true).eval(env).value;
2027
+ }).replace(/@\{([\w-]+)\}/g, function (_, name) {
2028
+ var v = new(tree.Variable)('@' + name, that.index).eval(env);
2029
+ return v.value || v.toCSS();
2030
+ });
2031
+ return new(tree.Quoted)(this.quote + value + this.quote, value, this.escaped, this.index);
1967
2032
  }
1968
2033
  };
1969
2034
 
@@ -2128,11 +2193,7 @@ tree.Ruleset.prototype = {
2128
2193
  if (context.length === 0) {
2129
2194
  paths = this.selectors.map(function (s) { return [s] });
2130
2195
  } else {
2131
- for (var s = 0; s < this.selectors.length; s++) {
2132
- for (var c = 0; c < context.length; c++) {
2133
- paths.push(context[c].concat([this.selectors[s]]));
2134
- }
2135
- }
2196
+ this.joinSelectors( paths, context, this.selectors );
2136
2197
  }
2137
2198
  }
2138
2199
 
@@ -2182,6 +2243,43 @@ tree.Ruleset.prototype = {
2182
2243
  css.push(rulesets);
2183
2244
 
2184
2245
  return css.join('') + (env.compress ? '\n' : '');
2246
+ },
2247
+
2248
+ joinSelectors: function (paths, context, selectors) {
2249
+ for (var s = 0; s < selectors.length; s++) {
2250
+ this.joinSelector(paths, context, selectors[s]);
2251
+ }
2252
+ },
2253
+
2254
+ joinSelector: function (paths, context, selector) {
2255
+ var before = [], after = [], beforeElements = [],
2256
+ afterElements = [], hasParentSelector = false, el;
2257
+
2258
+ for (var i = 0; i < selector.elements.length; i++) {
2259
+ el = selector.elements[i];
2260
+ if (el.combinator.value[0] === '&') {
2261
+ hasParentSelector = true;
2262
+ }
2263
+ if (hasParentSelector) afterElements.push(el);
2264
+ else beforeElements.push(el);
2265
+ }
2266
+
2267
+ if (! hasParentSelector) {
2268
+ afterElements = beforeElements;
2269
+ beforeElements = [];
2270
+ }
2271
+
2272
+ if (beforeElements.length > 0) {
2273
+ before.push(new(tree.Selector)(beforeElements));
2274
+ }
2275
+
2276
+ if (afterElements.length > 0) {
2277
+ after.push(new(tree.Selector)(afterElements));
2278
+ }
2279
+
2280
+ for (var c = 0; c < context.length; c++) {
2281
+ paths.push(before.concat(context[c]).concat(after));
2282
+ }
2185
2283
  }
2186
2284
  };
2187
2285
  })(require('less/tree'));
@@ -2220,7 +2318,7 @@ tree.URL = function (val, paths) {
2220
2318
  this.attrs = val;
2221
2319
  } else {
2222
2320
  // Add the base path if the URL is relative and we are in the browser
2223
- if (!/^(?:https?:\/|file:\/)?\//.test(val.value) && paths.length > 0 && typeof(window) !== 'undefined') {
2321
+ if (!/^(?:https?:\/|file:\/|data:\/)?\//.test(val.value) && paths.length > 0 && typeof(window) !== 'undefined') {
2224
2322
  val.value = paths[0] + (val.value.charAt(0) === '/' ? val.value.slice(1) : val.value);
2225
2323
  }
2226
2324
  this.value = val;
@@ -2269,13 +2367,17 @@ tree.Variable.prototype = {
2269
2367
  eval: function (env) {
2270
2368
  var variable, v, name = this.name;
2271
2369
 
2370
+ if (name.indexOf('@@') == 0) {
2371
+ name = '@' + new(tree.Variable)(name.slice(1)).eval(env).value;
2372
+ }
2373
+
2272
2374
  if (variable = tree.find(env.frames, function (frame) {
2273
2375
  if (v = frame.variable(name)) {
2274
2376
  return v.value.eval(env);
2275
2377
  }
2276
2378
  })) { return variable }
2277
2379
  else {
2278
- throw { message: "variable " + this.name + " is undefined",
2380
+ throw { message: "variable " + name + " is undefined",
2279
2381
  index: this.index };
2280
2382
  }
2281
2383
  }
@@ -2288,12 +2390,20 @@ require('less/tree').find = function (obj, fun) {
2288
2390
  }
2289
2391
  return null;
2290
2392
  };
2393
+ require('less/tree').jsify = function (obj) {
2394
+ if (Array.isArray(obj.value) && (obj.value.length > 1)) {
2395
+ return '[' + obj.value.map(function (v) { return v.toCSS(false) }).join(', ') + ']';
2396
+ } else {
2397
+ return obj.toCSS(false);
2398
+ }
2399
+ };
2291
2400
  //
2292
2401
  // browser.js - client-side engine
2293
2402
  //
2294
2403
 
2295
2404
  var isFileProtocol = (location.protocol === 'file:' ||
2296
2405
  location.protocol === 'chrome:' ||
2406
+ location.protocol === 'chrome-extension:' ||
2297
2407
  location.protocol === 'resource:');
2298
2408
 
2299
2409
  less.env = less.env || (location.hostname == '127.0.0.1' ||
@@ -2412,7 +2522,11 @@ function loadStyleSheet(sheet, callback, reload, remaining) {
2412
2522
 
2413
2523
  // Stylesheets in IE don't always return the full path
2414
2524
  if (! /^(https?|file):/.test(href)) {
2415
- href = url.slice(0, url.lastIndexOf('/') + 1) + href;
2525
+ if (href.charAt(0) == "/") {
2526
+ href = window.location.protocol + "//" + window.location.host + href;
2527
+ } else {
2528
+ href = url.slice(0, url.lastIndexOf('/') + 1) + href;
2529
+ }
2416
2530
  }
2417
2531
 
2418
2532
  xhr(sheet.href, sheet.type, function (data, lastModified) {
@@ -0,0 +1,16 @@
1
+ //
2
+ // LESS - Leaner CSS v1.1.4
3
+ // http://lesscss.org
4
+ //
5
+ // Copyright (c) 2009-2011, Alexis Sellier
6
+ // Licensed under the Apache 2.0 License.
7
+ //
8
+ //
9
+ // LESS - Leaner CSS v1.1.4
10
+ // http://lesscss.org
11
+ //
12
+ // Copyright (c) 2009-2011, Alexis Sellier
13
+ // Licensed under the Apache 2.0 License.
14
+ //
15
+ (function(a,b){function u(a,b){var c="less-error-message:"+o(b),e=["<ul>",'<li><label>[-1]</label><pre class="ctx">{0}</pre></li>',"<li><label>[0]</label><pre>{current}</pre></li>",'<li><label>[1]</label><pre class="ctx">{2}</pre></li>',"</ul>"].join("\n"),f=document.createElement("div"),g,h;f.id=c,f.className="less-error-message",h="<h3>"+(a.message||"There is an error in your .less file")+"</h3>"+'<p><a href="'+b+'">'+b+"</a> ",a.extract&&(h+="on line "+a.line+", column "+(a.column+1)+":</p>"+e.replace(/\[(-?\d)\]/g,function(b,c){return parseInt(a.line)+parseInt(c)||""}).replace(/\{(\d)\}/g,function(b,c){return a.extract[parseInt(c)]||""}).replace(/\{current\}/,a.extract[1].slice(0,a.column)+'<span class="error">'+a.extract[1].slice(a.column)+"</span>")),f.innerHTML=h,p([".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #ee4444;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.ctx {","color: #dd4444;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),f.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),d.env=="development"&&(g=setInterval(function(){document.body&&(document.getElementById(c)?document.body.replaceChild(f,document.getElementById(c)):document.body.insertBefore(f,document.body.firstChild),clearInterval(g))},10))}function t(a){d.env=="development"&&typeof console!="undefined"&&console.log("less: "+a)}function s(a){return a&&a.parentNode.removeChild(a)}function r(){if(a.XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(b){t("browser doesn't support AJAX.");return null}}function q(a,b,c,e){function i(b,c,d){b.status>=200&&b.status<300?c(b.responseText,b.getResponseHeader("Last-Modified")):typeof d=="function"&&d(b.status,a)}var g=r(),h=f?!1:d.async;typeof g.overrideMimeType=="function"&&g.overrideMimeType("text/css"),g.open("GET",a,h),g.setRequestHeader("Accept",b||"text/x-less, text/css; q=0.9, */*; q=0.5"),g.send(null),f?g.status===0?c(g.responseText):e(g.status,a):h?g.onreadystatechange=function(){g.readyState==4&&i(g,c,e)}:i(g,c,e)}function p(a,b,c){var d,e=b.href?b.href.replace(/\?.*$/,""):"",f="less:"+(b.title||o(e));(d=document.getElementById(f))===null&&(d=document.createElement("style"),d.type="text/css",d.media=b.media||"screen",d.id=f,document.getElementsByTagName("head")[0].appendChild(d));if(d.styleSheet)try{d.styleSheet.cssText=a}catch(h){throw new Error("Couldn't reassign styleSheet.cssText.")}else(function(a){d.childNodes.length>0?d.firstChild.nodeValue!==a.nodeValue&&d.replaceChild(a,d.firstChild):d.appendChild(a)})(document.createTextNode(a));c&&g&&(t("saving "+e+" to cache."),g.setItem(e,a),g.setItem(e+":timestamp",c))}function o(a){return a.replace(/^[a-z]+:\/\/?[^\/]+/,"").replace(/^\//,"").replace(/\?.*$/,"").replace(/\.[^\.\/]+$/,"").replace(/[^\.\w-]+/g,"-").replace(/\./g,":")}function n(b,c,e,f){var h=a.location.href.replace(/[#?].*$/,""),i=b.href.replace(/\?.*$/,""),j=g&&g.getItem(i),k=g&&g.getItem(i+":timestamp"),l={css:j,timestamp:k};/^(https?|file):/.test(i)||(i.charAt(0)=="/"?i=a.location.protocol+"//"+a.location.host+i:i=h.slice(0,h.lastIndexOf("/")+1)+i),q(b.href,b.type,function(a,g){if(!e&&l&&g&&(new Date(g)).valueOf()===(new Date(l.timestamp)).valueOf())p(l.css,b),c(null,b,{local:!0,remaining:f});else try{(new d.Parser({optimization:d.optimization,paths:[i.replace(/[\w\.-]+$/,"")],mime:b.type})).parse(a,function(a,d){if(a)return u(a,i);try{c(d,b,{local:!1,lastModified:g,remaining:f}),s(document.getElementById("less-error-message:"+o(i)))}catch(a){u(a,i)}})}catch(h){u(h,i)}},function(a,b){throw new Error("Couldn't load "+b+" ("+a+")")})}function m(a,b){for(var c=0;c<d.sheets.length;c++)n(d.sheets[c],a,b,d.sheets.length-(c+1))}function l(){var a=document.getElementsByTagName("style");for(var b=0;b<a.length;b++)a[b].type.match(j)&&(new d.Parser).parse(a[b].innerHTML||"",function(c,d){a[b].type="text/css",a[b].innerHTML=d.toCSS()})}function c(b){return a.less[b.split("/")[1]]}Array.isArray||(Array.isArray=function(a){return Object.prototype.toString.call(a)==="[object Array]"||a instanceof Array}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c=this.length>>>0;for(var d=0;d<c;d++)d in this&&a.call(b,this[d],d,this)}),Array.prototype.map||(Array.prototype.map=function(a){var b=this.length>>>0,c=Array(b),d=arguments[1];for(var e=0;e<b;e++)e in this&&(c[e]=a.call(d,this[e],e,this));return c}),Array.prototype.filter||(Array.prototype.filter=function(a){var b=[],c=arguments[1];for(var d=0;d<this.length;d++)a.call(c,this[d])&&b.push(this[d]);return b}),Array.prototype.reduce||(Array.prototype.reduce=function(a){var b=this.length>>>0,c=0;if(b===0&&arguments.length===1)throw new TypeError;if(arguments.length>=2)var d=arguments[1];else do{if(c in this){d=this[c++];break}if(++c>=b)throw new TypeError}while(!0);for(;c<b;c++)c in this&&(d=a.call(null,d,this[c],c,this));return d}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=this.length,c=arguments[1]||0;if(!b)return-1;if(c>=b)return-1;c<0&&(c+=b);for(;c<b;c++){if(!Object.prototype.hasOwnProperty.call(this,c))continue;if(a===this[c])return c}return-1}),Object.keys||(Object.keys=function(a){var b=[];for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c);return b}),String.prototype.trim||(String.prototype.trim=function(){return String(this).replace(/^\s\s*/,"").replace(/\s\s*$/,"")});var d,e;typeof a=="undefined"?(d=exports,e=c("less/tree")):(typeof a.less=="undefined"&&(a.less={}),d=a.less,e=a.less.tree={}),d.Parser=function(a){function t(a){return typeof a=="string"?b.charAt(c)===a:a.test(j[f])?!0:!1}function s(a){var d,e,g,h,i,m,n,o;if(a instanceof Function)return a.call(l.parsers);if(typeof a=="string")d=b.charAt(c)===a?a:null,g=1,r();else{r();if(d=a.exec(j[f]))g=d[0].length;else return null}if(d){o=c+=g,m=c+j[f].length-g;while(c<m){h=b.charCodeAt(c);if(h!==32&&h!==10&&h!==9)break;c++}j[f]=j[f].slice(g+(c-o)),k=c,j[f].length===0&&f<j.length-1&&f++;return typeof d=="string"?d:d.length===1?d[0]:d}}function r(){c>k&&(j[f]=j[f].slice(c-k),k=c)}function q(){j[f]=g,c=h,k=c}function p(){g=j[f],h=c,k=c}var b,c,f,g,h,i,j,k,l,m=this,n=function(){},o=this.imports={paths:a&&a.paths||[],queue:[],files:{},mime:a&&a.mime,push:function(b,c){var e=this;this.queue.push(b),d.Parser.importer(b,this.paths,function(a){e.queue.splice(e.queue.indexOf(b),1),e.files[b]=a,c(a),e.queue.length===0&&n()},a)}};this.env=a=a||{},this.optimization="optimization"in this.env?this.env.optimization:1,this.env.filename=this.env.filename||null;return l={imports:o,parse:function(d,g){var h,l,m,o,p,q,r=[],t,u=null;c=f=k=i=0,j=[],b=d.replace(/\r\n/g,"\n"),j=function(c){var d=0,e=/[^"'`\{\}\/\(\)]+/g,f=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,g=0,h,i=c[0],j,k;for(var l=0,m,n;l<b.length;l++){e.lastIndex=l,(h=e.exec(b))&&h.index===l&&(l+=h[0].length,i.push(h[0])),m=b.charAt(l),f.lastIndex=l,!k&&!j&&m==="/"&&(n=b.charAt(l+1),(n==="/"||n==="*")&&(h=f.exec(b))&&h.index===l&&(l+=h[0].length,i.push(h[0]),m=b.charAt(l)));if(m==="{"&&!k&&!j)g++,i.push(m);else if(m==="}"&&!k&&!j)g--,i.push(m),c[++d]=i=[];else if(m==="("&&!k&&!j)i.push(m),j=!0;else if(m===")"&&!k&&j)i.push(m),j=!1;else{if(m==='"'||m==="'"||m==="`")k?k=k===m?!1:k:k=m;i.push(m)}}if(g>0)throw{type:"Syntax",message:"Missing closing `}`",filename:a.filename};return c.map(function(a){return a.join("")})}([[]]),h=new e.Ruleset([],s(this.parsers.primary)),h.root=!0,h.toCSS=function(c){var d,f,g;return function(g,h){function n(a){return a?(b.slice(0,a).match(/\n/g)||"").length:null}var i=[];g=g||{},typeof h=="object"&&!Array.isArray(h)&&(h=Object.keys(h).map(function(a){var b=h[a];b instanceof e.Value||(b instanceof e.Expression||(b=new e.Expression([b])),b=new e.Value([b]));return new e.Rule("@"+a,b,!1,0)}),i=[new e.Ruleset(null,h)]);try{var j=c.call(this,{frames:i}).toCSS([],{compress:g.compress||!1})}catch(k){f=b.split("\n"),d=n(k.index);for(var l=k.index,m=-1;l>=0&&b.charAt(l)!=="\n";l--)m++;throw{type:k.type,message:k.message,filename:a.filename,index:k.index,line:typeof d=="number"?d+1:null,callLine:k.call&&n(k.call)+1,callExtract:f[n(k.call)],stack:k.stack,column:m,extract:[f[d-1],f[d],f[d+1]]}}return g.compress?j.replace(/(\s)+/g,"$1"):j}}(h.eval);if(c<b.length-1){c=i,q=b.split("\n"),p=(b.slice(0,c).match(/\n/g)||"").length+1;for(var v=c,w=-1;v>=0&&b.charAt(v)!=="\n";v--)w++;u={name:"ParseError",message:"Syntax Error on line "+p,index:c,filename:a.filename,line:p,column:w,extract:[q[p-2],q[p-1],q[p]]}}this.imports.queue.length>0?n=function(){g(u,h)}:g(u,h)},parsers:{primary:function(){var a,b=[];while((a=s(this.mixin.definition)||s(this.rule)||s(this.ruleset)||s(this.mixin.call)||s(this.comment)||s(this.directive))||s(/^[\s\n]+/))a&&b.push(a);return b},comment:function(){var a;if(b.charAt(c)==="/"){if(b.charAt(c+1)==="/")return new e.Comment(s(/^\/\/.*/),!0);if(a=s(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))return new e.Comment(a)}},entities:{quoted:function(){var a,d=c,f;b.charAt(d)==="~"&&(d++,f=!0);if(b.charAt(d)==='"'||b.charAt(d)==="'"){f&&s("~");if(a=s(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/))return new e.Quoted(a[0],a[1]||a[2],f)}},keyword:function(){var a;if(a=s(/^[A-Za-z-]+/))return new e.Keyword(a)},call:function(){var a,b,d=c;if(!!(a=/^([\w-]+|%)\(/.exec(j[f]))){a=a[1].toLowerCase();if(a==="url")return null;c+=a.length;if(a==="alpha")return s(this.alpha);s("("),b=s(this.entities.arguments);if(!s(")"))return;if(a)return new e.Call(a,b,d)}},arguments:function(){var a=[],b;while(b=s(this.expression)){a.push(b);if(!s(","))break}return a},literal:function(){return s(this.entities.dimension)||s(this.entities.color)||s(this.entities.quoted)},url:function(){var a;if(b.charAt(c)==="u"&&!!s(/^url\(/)){a=s(this.entities.quoted)||s(this.entities.variable)||s(this.entities.dataURI)||s(/^[-\w%@$\/.&=:;#+?~]+/)||"";if(!s(")"))throw new Error("missing closing ) for url()");return new e.URL(a.value||a.data||a instanceof e.Variable?a:new e.Anonymous(a),o.paths)}},dataURI:function(){var a;if(s(/^data:/)){a={},a.mime=s(/^[^\/]+\/[^,;)]+/)||"",a.charset=s(/^;\s*charset=[^,;)]+/)||"",a.base64=s(/^;\s*base64/)||"",a.data=s(/^,\s*[^)]+/);if(a.data)return a}},variable:function(){var a,d=c;if(b.charAt(c)==="@"&&(a=s(/^@@?[\w-]+/)))return new e.Variable(a,d)},color:function(){var a;if(b.charAt(c)==="#"&&(a=s(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)))return new e.Color(a[1])},dimension:function(){var a,d=b.charCodeAt(c);if(!(d>57||d<45||d===47))if(a=s(/^(-?\d*\.?\d+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn)?/))return new e.Dimension(a[1],a[2])},javascript:function(){var a,d=c,f;b.charAt(d)==="~"&&(d++,f=!0);if(b.charAt(d)==="`"){f&&s("~");if(a=s(/^`([^`]*)`/))return new e.JavaScript(a[1],c,f)}}},variable:function(){var a;if(b.charAt(c)==="@"&&(a=s(/^(@[\w-]+)\s*:/)))return a[1]},shorthand:function(){var a,b;if(!!t(/^[@\w.%-]+\/[@\w.-]+/)&&(a=s(this.entity))&&s("/")&&(b=s(this.entity)))return new e.Shorthand(a,b)},mixin:{call:function(){var a=[],d,f,g,h=c,i=b.charAt(c);if(i==="."||i==="#"){while(d=s(/^[#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/))a.push(new e.Element(f,d)),f=s(">");s("(")&&(g=s(this.entities.arguments))&&s(")");if(a.length>0&&(s(";")||t("}")))return new e.mixin.Call(a,g,h)}},definition:function(){var a,d=[],f,g,h,i;if(!(b.charAt(c)!=="."&&b.charAt(c)!=="#"||t(/^[^{]*(;|})/)))if(f=s(/^([#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+)\s*\(/)){a=f[1];while(h=s(this.entities.variable)||s(this.entities.literal)||s(this.entities.keyword)){if(h instanceof e.Variable)if(s(":"))if(i=s(this.expression))d.push({name:h.name,value:i});else throw new Error("Expected value");else d.push({name:h.name});else d.push({value:h});if(!s(","))break}if(!s(")"))throw new Error("Expected )");g=s(this.block);if(g)return new e.mixin.Definition(a,d,g)}}},entity:function(){return s(this.entities.literal)||s(this.entities.variable)||s(this.entities.url)||s(this.entities.call)||s(this.entities.keyword)||s(this.entities.javascript)||s(this.comment)},end:function(){return s(";")||t("}")},alpha:function(){var a;if(!!s(/^\(opacity=/i))if(a=s(/^\d+/)||s(this.entities.variable)){if(!s(")"))throw new Error("missing closing ) for alpha()");return new e.Alpha(a)}},element:function(){var a,b,c;c=s(this.combinator),a=s(/^(?:[.#]?|:*)(?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/)||s("*")||s(this.attribute)||s(/^\([^)@]+\)/)||s(/^(?:\d*\.)?\d+%/);if(a)return new e.Element(c,a);if(c.value&&c.value[0]==="&")return new e.Element(c,null)},combinator:function(){var a,d=b.charAt(c);if(d===">"||d==="+"||d==="~"){c++;while(b.charAt(c)===" ")c++;return new e.Combinator(d)}if(d==="&"){a="&",c++,b.charAt(c)===" "&&(a="& ");while(b.charAt(c)===" ")c++;return new e.Combinator(a)}if(d===":"&&b.charAt(c+1)===":"){c+=2;while(b.charAt(c)===" ")c++;return new e.Combinator("::")}return b.charAt(c-1)===" "?new e.Combinator(" "):new e.Combinator(null)},selector:function(){var a,d,f=[],g,h;while(d=s(this.element)){g=b.charAt(c),f.push(d);if(g==="{"||g==="}"||g===";"||g===",")break}if(f.length>0)return new e.Selector(f)},tag:function(){return s(/^[a-zA-Z][a-zA-Z-]*[0-9]?/)||s("*")},attribute:function(){var a="",b,c,d;if(!!s("[")){if(b=s(/^[a-zA-Z-]+/)||s(this.entities.quoted))(d=s(/^[|~*$^]?=/))&&(c=s(this.entities.quoted)||s(/^[\w-]+/))?a=[b,d,c.toCSS?c.toCSS():c].join(""):a=b;if(!s("]"))return;if(a)return"["+a+"]"}},block:function(){var a;if(s("{")&&(a=s(this.primary))&&s("}"))return a},ruleset:function(){var a=[],b,d,g;p();if(g=/^([.#:% \w-]+)[\s\n]*\{/.exec(j[f]))c+=g[0].length-1,a=[new e.Selector([new e.Element(null,g[1])])];else while(b=s(this.selector)){a.push(b),s(this.comment);if(!s(","))break;s(this.comment)}if(a.length>0&&(d=s(this.block)))return new e.Ruleset(a,d);i=c,q()},rule:function(){var a,d,g=b.charAt(c),k,l;p();if(g!=="."&&g!=="#"&&g!=="&")if(a=s(this.variable)||s(this.property)){a.charAt(0)!="@"&&(l=/^([^@+\/'"*`(;{}-]*);/.exec(j[f]))?(c+=l[0].length-1,d=new e.Anonymous(l[1])):a==="font"?d=s(this.font):d=s(this.value),k=s(this.important);if(d&&s(this.end))return new e.Rule(a,d,k,h);i=c,q()}},"import":function(){var a;if(s(/^@import\s+/)&&(a=s(this.entities.quoted)||s(this.entities.url))&&s(";"))return new e.Import(a,o)},directive:function(){var a,d,f,g;if(b.charAt(c)==="@"){if(d=s(this["import"]))return d;if(a=s(/^@media|@page/)||s(/^@(?:-webkit-)?keyframes/)){g=(s(/^[^{]+/)||"").trim();if(f=s(this.block))return new e.Directive(a+" "+g,f)}else if(a=s(/^@[-a-z]+/))if(a==="@font-face"){if(f=s(this.block))return new e.Directive(a,f)}else if((d=s(this.entity))&&s(";"))return new e.Directive(a,d)}},font:function(){var a=[],b=[],c,d,f,g;while(g=s(this.shorthand)||s(this.entity))b.push(g);a.push(new e.Expression(b));if(s(","))while(g=s(this.expression)){a.push(g);if(!s(","))break}return new e.Value(a)},value:function(){var a,b=[],c;while(a=s(this.expression)){b.push(a);if(!s(","))break}if(b.length>0)return new e.Value(b)},important:function(){if(b.charAt(c)==="!")return s(/^! *important/)},sub:function(){var a;if(s("(")&&(a=s(this.expression))&&s(")"))return a},multiplication:function(){var a,b,c,d;if(a=s(this.operand)){while((c=s("/")||s("*"))&&(b=s(this.operand)))d=new e.Operation(c,[d||a,b]);return d||a}},addition:function(){var a,d,f,g;if(a=s(this.multiplication)){while((f=s(/^[-+]\s+/)||b.charAt(c-1)!=" "&&(s("+")||s("-")))&&(d=s(this.multiplication)))g=new e.Operation(f,[g||a,d]);return g||a}},operand:function(){var a,d=b.charAt(c+1);b.charAt(c)==="-"&&(d==="@"||d==="(")&&(a=s("-"));var f=s(this.sub)||s(this.entities.dimension)||s(this.entities.color)||s(this.entities.variable)||s(this.entities.call);return a?new e.Operation("*",[new e.Dimension(-1),f]):f},expression:function(){var a,b,c=[],d;while(a=s(this.addition)||s(this.entity))c.push(a);if(c.length>0)return new e.Expression(c)},property:function(){var a;if(a=s(/^(\*?-?[-a-z_0-9]+)\s*:/))return a[1]}}}},typeof a!="undefined"&&(d.Parser.importer=function(a,b,c,d){a.charAt(0)!=="/"&&b.length>0&&(a=b[0]+a),n({href:a,title:a,type:d.mime},c,!0)}),function(a){function d(a){return Math.min(1,Math.max(0,a))}function c(b){if(b instanceof a.Dimension)return parseFloat(b.unit=="%"?b.value/100:b.value);if(typeof b=="number")return b;throw{error:"RuntimeError",message:"color functions take numbers as parameters"}}function b(b){return a.functions.hsla(b.h,b.s,b.l,b.a)}a.functions={rgb:function(a,b,c){return this.rgba(a,b,c,1)},rgba:function(b,d,e,f){var g=[b,d,e].map(function(a){return c(a)}),f=c(f);return new a.Color(g,f)},hsl:function(a,b,c){return this.hsla(a,b,c,1)},hsla:function(a,b,d,e){function h(a){a=a<0?a+1:a>1?a-1:a;return a*6<1?g+(f-g)*a*6:a*2<1?f:a*3<2?g+(f-g)*(2/3-a)*6:g}a=c(a)%360/360,b=c(b),d=c(d),e=c(e);var f=d<=.5?d*(b+1):d+b-d*b,g=d*2-f;return this.rgba(h(a+1/3)*255,h(a)*255,h(a-1/3)*255,e)},hue:function(b){return new a.Dimension(Math.round(b.toHSL().h))},saturation:function(b){return new a.Dimension(Math.round(b.toHSL().s*100),"%")},lightness:function(b){return new a.Dimension(Math.round(b.toHSL().l*100),"%")},alpha:function(b){return new a.Dimension(b.toHSL().a)},saturate:function(a,c){var e=a.toHSL();e.s+=c.value/100,e.s=d(e.s);return b(e)},desaturate:function(a,c){var e=a.toHSL();e.s-=c.value/100,e.s=d(e.s);return b(e)},lighten:function(a,c){var e=a.toHSL();e.l+=c.value/100,e.l=d(e.l);return b(e)},darken:function(a,c){var e=a.toHSL();e.l-=c.value/100,e.l=d(e.l);return b(e)},fadein:function(a,c){var e=a.toHSL();e.a+=c.value/100,e.a=d(e.a);return b(e)},fadeout:function(a,c){var e=a.toHSL();e.a-=c.value/100,e.a=d(e.a);return b(e)},spin:function(a,c){var d=a.toHSL(),e=(d.h+c.value)%360;d.h=e<0?360+e:e;return b(d)},mix:function(b,c,d){var e=d.value/100,f=e*2-1,g=b.toHSL().a-c.toHSL().a,h=((f*g==-1?f:(f+g)/(1+f*g))+1)/2,i=1-h,j=[b.rgb[0]*h+c.rgb[0]*i,b.rgb[1]*h+c.rgb[1]*i,b.rgb[2]*h+c.rgb[2]*i],k=b.alpha*e+c.alpha*(1-e);return new a.Color(j,k)},greyscale:function(b){return this.desaturate(b,new a.Dimension(100))},e:function(b){return new a.Anonymous(b instanceof a.JavaScript?b.evaluated:b)},escape:function(b){return new a.Anonymous(encodeURI(b.value).replace(/=/g,"%3D").replace(/:/g,"%3A").replace(/#/g,"%23").replace(/;/g,"%3B").replace(/\(/g,"%28").replace(/\)/g,"%29"))},"%":function(b){var c=Array.prototype.slice.call(arguments,1),d=b.value;for(var e=0;e<c.length;e++)d=d.replace(/%[sda]/i,function(a){var b=a.match(/s/i)?c[e].value:c[e].toCSS();return a.match(/[A-Z]$/)?encodeURIComponent(b):b});d=d.replace(/%%/g,"%");return new a.Quoted('"'+d+'"',d)},round:function(b){if(b instanceof a.Dimension)return new a.Dimension(Math.round(c(b)),b.unit);if(typeof b=="number")return Math.round(b);throw{error:"RuntimeError",message:"math functions take numbers as parameters"}}}}(c("less/tree")),function(a){a.Alpha=function(a){this.value=a},a.Alpha.prototype={toCSS:function(){return"alpha(opacity="+(this.value.toCSS?this.value.toCSS():this.value)+")"},eval:function(a){this.value.eval&&(this.value=this.value.eval(a));return this}}}(c("less/tree")),function(a){a.Anonymous=function(a){this.value=a.value||a},a.Anonymous.prototype={toCSS:function(){return this.value},eval:function(){return this}}}(c("less/tree")),function(a){a.Call=function(a,b,c){this.name=a,this.args=b,this.index=c},a.Call.prototype={eval:function(b){var c=this.args.map(function(a){return a.eval(b)});if(!(this.name in a.functions))return new a.Anonymous(this.name+"("+c.map(function(a){return a.toCSS()}).join(", ")+")");try{return a.functions[this.name].apply(a.functions,c)}catch(d){throw{message:"error evaluating function `"+this.name+"`",index:this.index}}},toCSS:function(a){return this.eval(a).toCSS()}}}(c("less/tree")),function(a){a.Color=function(a,b){Array.isArray(a)?this.rgb=a:a.length==6?this.rgb=a.match(/.{2}/g).map(function(a){return parseInt(a,16)}):a.length==8?(this.alpha=parseInt(a.substring(0,2),16)/255,this.rgb=a.substr(2).match(/.{2}/g).map(function(a){return parseInt(a,16)})):this.rgb=a.split("").map(function(a){return parseInt(a+a,16)}),this.alpha=typeof b=="number"?b:1},a.Color.prototype={eval:function(){return this},toCSS:function(){return this.alpha<1?"rgba("+this.rgb.map(function(a){return Math.round(a)}).concat(this.alpha).join(", ")+")":"#"+this.rgb.map(function(a){a=Math.round(a),a=(a>255?255:a<0?0:a).toString(16);return a.length===1?"0"+a:a}).join("")},operate:function(b,c){var d=[];c instanceof a.Color||(c=c.toColor());for(var e=0;e<3;e++)d[e]=a.operate(b,this.rgb[e],c.rgb[e]);return new a.Color(d,this.alpha+c.alpha)},toHSL:function(){var a=this.rgb[0]/255,b=this.rgb[1]/255,c=this.rgb[2]/255,d=this.alpha,e=Math.max(a,b,c),f=Math.min(a,b,c),g,h,i=(e+f)/2,j=e-f;if(e===f)g=h=0;else{h=i>.5?j/(2-e-f):j/(e+f);switch(e){case a:g=(b-c)/j+(b<c?6:0);break;case b:g=(c-a)/j+2;break;case c:g=(a-b)/j+4}g/=6}return{h:g*360,s:h,l:i,a:d}}}}(c("less/tree")),function(a){a.Comment=function(a,b){this.value=a,this.silent=!!b},a.Comment.prototype={toCSS:function(a){return a.compress?"":this.value},eval:function(){return this}}}(c("less/tree")),function(a){a.Dimension=function(a,b){this.value=parseFloat(a),this.unit=b||null},a.Dimension.prototype={eval:function(){return this},toColor:function(){return new a.Color([this.value,this.value,this.value])},toCSS:function(){var a=this.value+this.unit;return a},operate:function(b,c){return new a.Dimension(a.operate(b,this.value,c.value),this.unit||c.unit)}}}(c("less/tree")),function(a){a.Directive=function(b,c){this.name=b,Array.isArray(c)?this.ruleset=new a.Ruleset([],c):this.value=c},a.Directive.prototype={toCSS:function(a,b){if(this.ruleset){this.ruleset.root=!0;return this.name+(b.compress?"{":" {\n ")+this.ruleset.toCSS(a,b).trim().replace(/\n/g,"\n ")+(b.compress?"}":"\n}\n")}return this.name+" "+this.value.toCSS()+";\n"},eval:function(a){a.frames.unshift(this),this.ruleset=this.ruleset&&this.ruleset.eval(a),a.frames.shift();return this},variable:function(b){return a.Ruleset.prototype.variable.call(this.ruleset,b)},find:function(){return a.Ruleset.prototype.find.apply(this.ruleset,arguments)},rulesets:function(){return a.Ruleset.prototype.rulesets.apply(this.ruleset)}}}(c("less/tree")),function(a){a.Element=function(b,c){this.combinator=b instanceof a.Combinator?b:new a.Combinator(b),this.value=c?c.trim():""},a.Element.prototype.toCSS=function(a){return this.combinator.toCSS(a||{})+this.value},a.Combinator=function(a){a===" "?this.value=" ":a==="& "?this.value="& ":this.value=a?a.trim():""},a.Combinator.prototype.toCSS=function(a){return{"":""," ":" ","&":"","& ":" ",":":" :","::":"::","+":a.compress?"+":" + ","~":a.compress?"~":" ~ ",">":a.compress?">":" > "}[this.value]}}(c("less/tree")),function(a){a.Expression=function(a){this.value=a},a.Expression.prototype={eval:function(b){return this.value.length>1?new a.Expression(this.value.map(function(a){return a.eval(b)})):this.value.length===1?this.value[0].eval(b):this},toCSS:function(a){return this.value.map(function(b){return b.toCSS(a)}).join(" ")}}}(c("less/tree")),function(a){a.Import=function(b,c){var d=this;this._path=b,b instanceof a.Quoted?this.path=/\.(le?|c)ss$/.test(b.value)?b.value:b.value+".less":this.path=b.value.value||b.value,this.css=/css$/.test(this.path),this.css||c.push(this.path,function(a){if(!a)throw new Error("Error parsing "+d.path);d.root=a})},a.Import.prototype={toCSS:function(){return this.css?"@import "+this._path.toCSS()+";\n":""},eval:function(b){var c;if(this.css)return this;c=new a.Ruleset(null,this.root.rules.slice(0));for(var d=0;d<c.rules.length;d++)c.rules[d]instanceof a.Import&&Array.prototype.splice.apply(c.rules,[d,1].concat(c.rules[d].eval(b)));return c.rules}}}(c("less/tree")),function(a){a.JavaScript=function(a,b,c){this.escaped=c,this.expression=a,this.index=b},a.JavaScript.prototype={eval:function(b){var c,d=this,e={},f=this.expression.replace(/@\{([\w-]+)\}/g,function(c,e){return a.jsify((new a.Variable("@"+e,d.index)).eval(b))});try{f=new Function("return ("+f+")")}catch(g){throw{message:"JavaScript evaluation error: `"+f+"`",index:this.index}}for(var h in b.frames[0].variables())e[h.slice(1)]={value:b.frames[0].variables()[h].value,toJS:function(){return this.value.eval(b).toCSS()}};try{c=f.call(e)}catch(g){throw{message:"JavaScript evaluation error: '"+g.name+": "+g.message+"'",index:this.index}}return typeof c=="string"?new a.Quoted('"'+c+'"',c,this.escaped,this.index):Array.isArray(c)?new a.Anonymous(c.join(", ")):new a.Anonymous(c)}}}(c("less/tree")),function(a){a.Keyword=function(a){this.value=a},a.Keyword.prototype={eval:function(){return this},toCSS:function(){return this.value}}}(c("less/tree")),function(a){a.mixin={},a.mixin.Call=function(b,c,d){this.selector=new a.Selector(b),this.arguments=c,this.index=d},a.mixin.Call.prototype={eval:function(a){var b,c,d=[],e=!1;for(var f=0;f<a.frames.length;f++)if((b=a.frames[f].find(this.selector)).length>0){c=this.arguments&&this.arguments.map(function(b){return b.eval(a)});for(var g=0;g<b.length;g++)if(b[g].match(c,a))try{Array.prototype.push.apply(d,b[g].eval(a,this.arguments).rules),e=!0}catch(h){throw{message:h.message,index:h.index,stack:h.stack,call:this.index}}if(e)return d;throw{message:"No matching definition was found for `"+this.selector.toCSS().trim()+"("+this.arguments.map(function(a){return a.toCSS()}).join(", ")+")`",index:this.index}}throw{message:this.selector.toCSS().trim()+" is undefined",index:this.index}}},a.mixin.Definition=function(b,c,d){this.name=b,this.selectors=[new a.Selector([new a.Element(null,b)])],this.params=c,this.arity=c.length,this.rules=d,this._lookups={},this.required=c.reduce(function(a,b){return!b.name||b.name&&!b.value?a+1:a},0),this.parent=a.Ruleset.prototype,this.frames=[]},a.mixin.Definition.prototype={toCSS:function(){return""},variable:function(a){return this.parent.variable.call(this,a)},variables:function(){return this.parent.variables.call(this)},find:function(){return this.parent.find.apply(this,arguments)},rulesets:function(){return this.parent.rulesets.apply(this)},eval:function(b,c){var d=new a.Ruleset(null,[]),e,f=[];for(var g=0,h;g<this.params.length;g++)if(this.params[g].name)if(h=c&&c[g]||this.params[g].value)d.rules.unshift(new a.Rule(this.params[g].name,h.eval(b)));else throw{message:"wrong number of arguments for "+this.name+" ("+c.length+" for "+this.arity+")"};for(var g=0;g<Math.max(this.params.length,c&&c.length);g++)f.push(c[g]||this.params[g].value);d.rules.unshift(new a.Rule("@arguments",(new a.Expression(f)).eval(b)));return(new a.Ruleset(null,this.rules.slice(0))).eval({frames:[this,d].concat(this.frames,b.frames)})},match:function(a,b){var c=a&&a.length||0,d;if(c<this.required)return!1;if(this.required>0&&c>this.params.length)return!1;d=Math.min(c,this.arity);for(var e=0;e<d;e++)if(!this.params[e].name&&a[e].eval(b).toCSS()!=this.params[e].value.eval(b).toCSS())return!1;return!0}}}(c("less/tree")),function(a){a.Operation=function(a,b){this.op=a.trim(),this.operands=b},a.Operation.prototype.eval=function(b){var c=this.operands[0].eval(b),d=this.operands[1].eval(b),e;if(c instanceof a.Dimension&&d instanceof a.Color)if(this.op==="*"||this.op==="+")e=d,d=c,c=e;else throw{name:"OperationError",message:"Can't substract or divide a color from a number"};return c.operate(this.op,d)},a.operate=function(a,b,c){switch(a){case"+":return b+c;case"-":return b-c;case"*":return b*c;case"/":return b/c}}}(c("less/tree")),function(a){a.Quoted=function(a,b,c,d){this.escaped=c,this.value=b||"",this.quote=a.charAt(0),this.index=d},a.Quoted.prototype={toCSS:function(){return this.escaped?this.value:this.quote+this.value+this.quote},eval:function(b){var c=this,d=this.value.replace(/`([^`]+)`/g,function(d,e){return(new a.JavaScript(e,c.index,!0)).eval(b).value}).replace(/@\{([\w-]+)\}/g,function(d,e){var f=(new a.Variable("@"+e,c.index)).eval(b);return f.value||f.toCSS()});return new a.Quoted(this.quote+d+this.quote,d,this.escaped,this.index)}}}(c("less/tree")),function(a){a.Rule=function(b,c,d,e){this.name=b,this.value=c instanceof a.Value?c:new a.Value([c]),this.important=d?" "+d.trim():"",this.index=e,b.charAt(0)==="@"?this.variable=!0:this.variable=!1},a.Rule.prototype.toCSS=function(a){return this.variable?"":this.name+(a.compress?":":": ")+this.value.toCSS(a)+this.important+";"},a.Rule.prototype.eval=function(b){return new a.Rule(this.name,this.value.eval(b),this.important,this.index)},a.Shorthand=function(a,b){this.a=a,this.b=b},a.Shorthand.prototype={toCSS:function(a){return this.a.toCSS(a)+"/"+this.b.toCSS(a)},eval:function(){return this}}}(c("less/tree")),function(a){a.Ruleset=function(a,b){this.selectors=a,this.rules=b,this._lookups={}},a.Ruleset.prototype={eval:function(b){var c=new a.Ruleset(this.selectors,this.rules.slice(0));c.root=this.root,b.frames.unshift(c);if(c.root)for(var d=0;d<c.rules.length;d++)c.rules[d]instanceof a.Import&&Array.prototype.splice.apply(c.rules,[d,1].concat(c.rules[d].eval(b)));for(var d=0;d<c.rules.length;d++)c.rules[d]instanceof a.mixin.Definition&&(c.rules[d].frames=b.frames.slice(0));for(var d=0;d<c.rules.length;d++)c.rules[d]instanceof a.mixin.Call&&Array.prototype.splice.apply(c.rules,[d,1].concat(c.rules[d].eval(b)));for(var d=0,e;d<c.rules.length;d++)e=c.rules[d],e instanceof a.mixin.Definition||(c.rules[d]=e.eval?e.eval(b):e);b.frames.shift();return c},match:function(a){return!a||a.length===0},variables:function(){return this._variables?this._variables:this._variables=this.rules.reduce(function(b,c){c instanceof a.Rule&&c.variable===!0&&(b[c.name]=c);return b},{})},variable:function(a){return this.variables()[a]},rulesets:function(){return this._rulesets?this._rulesets:this._rulesets=this.rules.filter(function(b){return b instanceof a.Ruleset||b instanceof a.mixin.Definition})},find:function(b,c){c=c||this;var d=[],e,f,g=b.toCSS();if(g in this._lookups)return this._lookups[g];this.rulesets().forEach(function(e){if(e!==c)for(var g=0;g<e.selectors.length;g++)if(f=b.match(e.selectors[g])){b.elements.length>1?Array.prototype.push.apply(d,e.find(new a.Selector(b.elements.slice(1)),c)):d.push(e);break}});return this._lookups[g]=d},toCSS:function(b,c){var d=[],e=[],f=[],g=[],h,i;this.root||(b.length===0?g=this.selectors.map(function(a){return[a]}):this.joinSelectors(g,b,this.selectors));for(var j=0;j<this.rules.length;j++)i=this.rules[j],i.rules||i instanceof a.Directive?f.push(i.toCSS(g,c)):i instanceof a.Comment?i.silent||(this.root?f.push(i.toCSS(c)):e.push(i.toCSS(c))):i.toCSS&&!i.variable?e.push(i.toCSS(c)):i.value&&!i.variable&&e.push(i.value.toString());f=f.join(""),this.root?d.push(e.join(c.compress?"":"\n")):e.length>0&&(h=g.map(function(a){return a.map(function(a){return a.toCSS(c)}).join("").trim()}).join(c.compress?",":g.length>3?",\n":", "),d.push(h,(c.compress?"{":" {\n ")+e.join(c.compress?"":"\n ")+(c.compress?"}":"\n}\n"))),d.push(f);return d.join("")+(c.compress?"\n":"")},joinSelectors:function(a,b,c){for(var d=0;d<c.length;d++)this.joinSelector(a,b,c[d])},joinSelector:function(b,c,d){var e=[],f=[],g=[],h=[],i=!1,j;for(var k=0;k<d.elements.length;k++)j=d.elements[k],j.combinator.value[0]==="&"&&(i=!0),i?h.push(j):g.push(j);i||(h=g,g=[]),g.length>0&&e.push(new a.Selector(g)),h.length>0&&f.push(new a.Selector(h));for(var l=0;l<c.length;l++)b.push(e.concat(c[l]).concat(f))}}}(c("less/tree")),function(a){a.Selector=function(a){this.elements=a,this.elements[0].combinator.value===""&&(this.elements[0].combinator.value=" ")},a.Selector.prototype.match=function(a){return this.elements[0].value===a.elements[0].value?!0:!1},a.Selector.prototype.toCSS=function(a){return this._css?this._css:this._css=this.elements.map(function(b){return typeof b=="string"?" "+b.trim():b.toCSS(a)}).join("")}}(c("less/tree")),function(b){b.URL=function(b,c){b.data?this.attrs=b:(!/^(?:https?:\/|file:\/|data:\/)?\//.test(b.value)&&c.length>0&&typeof a!="undefined"&&(b.value=c[0]+(b.value.charAt(0)==="/"?b.value.slice(1):b.value)),this.value=b,this.paths=c)},b.URL.prototype={toCSS:function(){return"url("+(this.attrs?"data:"+this.attrs
16
+ .mime+this.attrs.charset+this.attrs.base64+this.attrs.data:this.value.toCSS())+")"},eval:function(a){return this.attrs?this:new b.URL(this.value.eval(a),this.paths)}}}(c("less/tree")),function(a){a.Value=function(a){this.value=a,this.is="value"},a.Value.prototype={eval:function(b){return this.value.length===1?this.value[0].eval(b):new a.Value(this.value.map(function(a){return a.eval(b)}))},toCSS:function(a){return this.value.map(function(b){return b.toCSS(a)}).join(a.compress?",":", ")}}}(c("less/tree")),function(a){a.Variable=function(a,b){this.name=a,this.index=b},a.Variable.prototype={eval:function(b){var c,d,e=this.name;e.indexOf("@@")==0&&(e="@"+(new a.Variable(e.slice(1))).eval(b).value);if(c=a.find(b.frames,function(a){if(d=a.variable(e))return d.value.eval(b)}))return c;throw{message:"variable "+e+" is undefined",index:this.index}}}}(c("less/tree")),c("less/tree").find=function(a,b){for(var c=0,d;c<a.length;c++)if(d=b.call(a,a[c]))return d;return null},c("less/tree").jsify=function(a){return Array.isArray(a.value)&&a.value.length>1?"["+a.value.map(function(a){return a.toCSS(!1)}).join(", ")+"]":a.toCSS(!1)};var f=location.protocol==="file:"||location.protocol==="chrome:"||location.protocol==="chrome-extension:"||location.protocol==="resource:";d.env=d.env||(location.hostname=="127.0.0.1"||location.hostname=="0.0.0.0"||location.hostname=="localhost"||location.port.length>0||f?"development":"production"),d.async=!1,d.poll=d.poll||(f?1e3:1500),d.watch=function(){return this.watchMode=!0},d.unwatch=function(){return this.watchMode=!1},d.env==="development"?(d.optimization=0,/!watch/.test(location.hash)&&d.watch(),d.watchTimer=setInterval(function(){d.watchMode&&m(function(a,b,c){a&&p(a.toCSS(),b,c.lastModified)})},d.poll)):d.optimization=3;var g;try{g=typeof a.localStorage=="undefined"?null:a.localStorage}catch(h){g=null}var i=document.getElementsByTagName("link"),j=/^text\/(x-)?less$/;d.sheets=[];for(var k=0;k<i.length;k++)(i[k].rel==="stylesheet/less"||i[k].rel.match(/stylesheet/)&&i[k].type.match(j))&&d.sheets.push(i[k]);d.refresh=function(a){var b,c;b=c=new Date,m(function(a,d,e){e.local?t("loading "+d.href+" from cache."):(t("parsed "+d.href+" successfully."),p(a.toCSS(),d,e.lastModified)),t("css for "+d.href+" generated in "+(new Date-c)+"ms"),e.remaining===0&&t("css generated in "+(new Date-b)+"ms"),c=new Date},a),l()},d.refreshStyles=l,d.refresh(d.env==="development")})(window)