less 2.5.1 → 2.6.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 (150) hide show
  1. package/.travis.yml +3 -2
  2. package/CHANGELOG.md +41 -0
  3. package/Gruntfile.js +5 -10
  4. package/README.md +3 -3
  5. package/appveyor.yml +2 -2
  6. package/bin/lessc +1 -0
  7. package/bower.json +1 -2
  8. package/dist/less.js +969 -605
  9. package/dist/less.min.js +13 -9
  10. package/gradlew +0 -0
  11. package/lib/less/contexts.js +0 -1
  12. package/lib/less/functions/color.js +5 -2
  13. package/lib/less/functions/math-helper.js +16 -0
  14. package/lib/less/functions/math.js +4 -16
  15. package/lib/less/functions/number.js +7 -2
  16. package/lib/less/index.js +1 -1
  17. package/lib/less/parser/parser-input.js +68 -68
  18. package/lib/less/parser/parser.js +159 -75
  19. package/lib/less/transform-tree.js +1 -0
  20. package/lib/less/tree/anonymous.js +4 -2
  21. package/lib/less/tree/color.js +4 -1
  22. package/lib/less/tree/comment.js +2 -6
  23. package/lib/less/tree/directive.js +3 -18
  24. package/lib/less/tree/element.js +9 -2
  25. package/lib/less/tree/extend.js +10 -5
  26. package/lib/less/tree/import.js +23 -5
  27. package/lib/less/tree/media.js +4 -2
  28. package/lib/less/tree/mixin-call.js +31 -18
  29. package/lib/less/tree/mixin-definition.js +19 -7
  30. package/lib/less/tree/node.js +49 -0
  31. package/lib/less/tree/rule.js +1 -1
  32. package/lib/less/tree/ruleset.js +107 -125
  33. package/lib/less/tree/selector.js +4 -9
  34. package/lib/less/tree/unit.js +2 -2
  35. package/lib/less/visitors/extend-visitor.js +17 -8
  36. package/lib/less/visitors/import-visitor.js +5 -0
  37. package/lib/less/visitors/index.js +1 -0
  38. package/lib/less/visitors/set-tree-visibility-visitor.js +38 -0
  39. package/lib/less/visitors/to-css-visitor.js +181 -98
  40. package/lib/less-browser/bootstrap.js +28 -2
  41. package/lib/less-browser/cache.js +11 -4
  42. package/lib/less-browser/error-reporting.js +10 -10
  43. package/lib/less-browser/file-manager.js +1 -1
  44. package/lib/less-browser/image-size.js +28 -0
  45. package/lib/less-browser/index.js +9 -10
  46. package/package.json +14 -14
  47. package/test/browser/less/errors/image-height-error.less +3 -0
  48. package/test/browser/less/errors/image-height-error.txt +4 -0
  49. package/test/browser/less/errors/image-size-error.less +3 -0
  50. package/test/browser/less/errors/image-size-error.txt +4 -0
  51. package/test/browser/less/errors/image-width-error.less +3 -0
  52. package/test/browser/less/errors/image-width-error.txt +4 -0
  53. package/test/browser/less.js +23 -19
  54. package/test/css/comments2.css +7 -1
  55. package/test/css/compression/compression.css +1 -1
  56. package/test/css/css-3.css +6 -0
  57. package/test/css/extend-selector.css +7 -0
  58. package/test/css/extract-and-length.css +1 -1
  59. package/test/css/functions.css +3 -3
  60. package/test/css/import-reference-issues.css +24 -0
  61. package/test/css/import-reference.css +5 -1
  62. package/test/css/include-path/include-path.css +1 -1
  63. package/test/css/include-path-string/include-path-string.css +1 -1
  64. package/test/css/mixins-args.css +51 -1
  65. package/test/css/mixins-guards.css +36 -0
  66. package/test/css/no-strict-math/mixins-guards.css +12 -0
  67. package/test/css/no-strict-math/no-sm-operations.css +12 -0
  68. package/test/css/operations.css +1 -0
  69. package/test/css/scope.css +1 -1
  70. package/test/css/strings.css +1 -1
  71. package/test/css/url-args/urls.css +5 -5
  72. package/test/css/urls.css +8 -8
  73. package/test/css/variables.css +5 -5
  74. package/test/data/image.jpg +0 -0
  75. package/test/data/image.svg +2 -1
  76. package/test/data/page.html +1 -1
  77. package/test/index.js +1 -0
  78. package/test/less/comments2.less +11 -0
  79. package/test/less/css-3.less +10 -2
  80. package/test/less/errors/at-rules-undefined-var.txt +4 -4
  81. package/test/less/errors/css-guard-default-func.txt +4 -4
  82. package/test/less/errors/javascript-undefined-var.txt +4 -4
  83. package/test/less/errors/mixins-guards-default-func-1.txt +4 -4
  84. package/test/less/errors/mixins-guards-default-func-2.txt +4 -4
  85. package/test/less/errors/mixins-guards-default-func-3.txt +4 -4
  86. package/test/less/errors/parse-error-media-no-block-1.txt +1 -1
  87. package/test/less/errors/parse-error-media-no-block-2.txt +1 -1
  88. package/test/less/errors/parse-error-media-no-block-3.txt +1 -1
  89. package/test/less/errors/percentage-non-number-argument.less +3 -0
  90. package/test/less/errors/percentage-non-number-argument.txt +4 -0
  91. package/test/less/errors/property-interp-not-defined.txt +2 -2
  92. package/test/less/extend-selector.less +12 -1
  93. package/test/less/import/import-inline-invalid-css.less +1 -0
  94. package/test/less/import/import-reference.less +10 -1
  95. package/test/less/import-reference-issues/appender-reference-1968.less +6 -0
  96. package/test/less/import-reference-issues/global-scope-import.less +13 -0
  97. package/test/less/import-reference-issues/global-scope-nested.less +3 -0
  98. package/test/less/import-reference-issues/mixin-1968.less +8 -0
  99. package/test/less/import-reference-issues/multiple-import-nested.less +12 -0
  100. package/test/less/import-reference-issues/multiple-import.less +10 -0
  101. package/test/less/import-reference-issues/simple-mixin.css +3 -0
  102. package/test/less/import-reference-issues/simple-ruleset-2162.less +3 -0
  103. package/test/less/import-reference-issues.less +50 -0
  104. package/test/less/import-reference.less +2 -0
  105. package/test/less/mixins-args.less +48 -0
  106. package/test/less/mixins-guards.less +78 -0
  107. package/test/less/no-strict-math/mixins-guards.less +25 -0
  108. package/test/less/no-strict-math/no-sm-operations.less +10 -0
  109. package/test/less/operations.less +1 -0
  110. package/test/less-bom/comments2.less +11 -0
  111. package/test/less-bom/css-3.less +10 -2
  112. package/test/less-bom/errors/at-rules-undefined-var.txt +4 -4
  113. package/test/less-bom/errors/css-guard-default-func.txt +4 -4
  114. package/test/less-bom/errors/javascript-undefined-var.txt +4 -4
  115. package/test/less-bom/errors/mixins-guards-default-func-1.txt +4 -4
  116. package/test/less-bom/errors/mixins-guards-default-func-2.txt +4 -4
  117. package/test/less-bom/errors/mixins-guards-default-func-3.txt +4 -4
  118. package/test/less-bom/errors/parse-error-media-no-block-1.txt +1 -1
  119. package/test/less-bom/errors/parse-error-media-no-block-2.txt +1 -1
  120. package/test/less-bom/errors/parse-error-media-no-block-3.txt +1 -1
  121. package/test/less-bom/errors/percentage-non-number-argument.less +3 -0
  122. package/test/less-bom/errors/percentage-non-number-argument.txt +4 -0
  123. package/test/less-bom/errors/property-interp-not-defined.txt +2 -2
  124. package/test/less-bom/extend-selector.less +12 -1
  125. package/test/less-bom/import/import-inline-invalid-css.less +1 -0
  126. package/test/less-bom/import/import-reference.less +10 -1
  127. package/test/less-bom/import-reference-issues/appender-reference-1968.less +6 -0
  128. package/test/less-bom/import-reference-issues/global-scope-import.less +13 -0
  129. package/test/less-bom/import-reference-issues/global-scope-nested.less +3 -0
  130. package/test/less-bom/import-reference-issues/mixin-1968.less +8 -0
  131. package/test/less-bom/import-reference-issues/multiple-import-nested.less +12 -0
  132. package/test/less-bom/import-reference-issues/multiple-import.less +10 -0
  133. package/test/less-bom/import-reference-issues/simple-mixin.css +3 -0
  134. package/test/less-bom/import-reference-issues/simple-ruleset-2162.less +3 -0
  135. package/test/less-bom/import-reference-issues.less +50 -0
  136. package/test/less-bom/import-reference.less +2 -0
  137. package/test/less-bom/mixins-args.less +48 -0
  138. package/test/less-bom/mixins-guards.less +78 -0
  139. package/test/less-bom/no-strict-math/mixins-guards.less +25 -0
  140. package/test/less-bom/no-strict-math/no-sm-operations.less +10 -0
  141. package/test/less-bom/operations.less +1 -0
  142. package/test/less-test.js +6 -1
  143. package/.idea/.name +0 -1
  144. package/.idea/jsLibraryMappings.xml +0 -6
  145. package/.idea/less.js.iml +0 -9
  146. package/.idea/libraries/less_js_node_modules.xml +0 -14
  147. package/.idea/misc.xml +0 -14
  148. package/.idea/modules.xml +0 -8
  149. package/.idea/vcs.xml +0 -6
  150. package/.idea/workspace.xml +0 -281
@@ -3,7 +3,7 @@
3
3
  }
4
4
  .variables {
5
5
  height: 24px;
6
- color: #888888;
6
+ color: #888;
7
7
  font-family: "Trebuchet MS", Verdana, sans-serif;
8
8
  quotes: "~" "~";
9
9
  }
@@ -16,10 +16,10 @@
16
16
  .values {
17
17
  minus-one: -1;
18
18
  font-family: 'Trebuchet', 'Trebuchet', 'Trebuchet';
19
- color: #888888 !important;
20
- same-color: #888888 !important;
21
- same-again: #888888 !important;
22
- multi-important: #888888 #888888, 'Trebuchet' !important;
19
+ color: #888 !important;
20
+ same-color: #888 !important;
21
+ same-again: #888 !important;
22
+ multi-important: #888 #888, 'Trebuchet' !important;
23
23
  multi: something 'A', B, C, 'Trebuchet';
24
24
  }
25
25
  .variable-names .quoted {
Binary file
@@ -1,3 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
1
2
  <svg height="100" width="100">
2
3
  <circle cx="50" cy="50" r="40" stroke="black" stroke-width="1" fill="blue" />
3
- </svg>
4
+ </svg>
@@ -1 +1 @@
1
- <h1>This page is 100% Awesome.</h1>
1
+ <html><h1>This page is 100% Awesome.</h1></html>
package/test/index.js CHANGED
@@ -52,6 +52,7 @@ lessTester.runTestSet({plugin: 'test/plugins/postprocess/'}, "postProcessorPlugi
52
52
  lessTester.runTestSet({plugin: 'test/plugins/preprocess/'}, "preProcessorPlugin/");
53
53
  lessTester.runTestSet({plugin: 'test/plugins/visitor/'}, "visitorPlugin/");
54
54
  lessTester.runTestSet({plugin: 'test/plugins/filemanager/'}, "filemanagerPlugin/");
55
+ lessTester.runTestSet({}, "no-strict-math/");
55
56
  lessTester.testSyncronous({syncImport: true}, "import");
56
57
  lessTester.testSyncronous({syncImport: true}, "css");
57
58
  lessTester.testNoOptions();
@@ -18,3 +18,14 @@
18
18
  @gutter-width * // We strongly recommend you */
19
19
  @columns); // do not change this formula. */
20
20
  @total-width : @gridsystem-width; // set to 100% for fluid grid */
21
+
22
+ // .............................................................................
23
+
24
+ .some-inline-comments {
25
+ a: yes /* comment */;
26
+ b: red /* comment */;
27
+ @c: yes /* comment */;
28
+ @d: red /* comment */;
29
+ c: @c;
30
+ d: @d;
31
+ }
@@ -144,11 +144,19 @@ body ^^ .shadow {
144
144
  #issue2066 {
145
145
  background: url('/images/icon-team.svg') 0 0 / contain;
146
146
  }
147
+
147
148
  @counter-style triangle {
148
149
  system: cyclic;
149
150
  symbols: ‣;
150
151
  suffix: " ";
151
152
  }
153
+
152
154
  @-ms-viewport{
153
- //width: auto !important;
154
- }
155
+ // width: auto !important;
156
+ }
157
+
158
+ @unknown foo 42 (bar) {
159
+ x {y: z}
160
+ }
161
+
162
+ @unknown foo 43;
@@ -1,4 +1,4 @@
1
- NameError: variable @name is undefined in {path}at-rules-undefined-var.less on line 2, column 12:
2
- 1
3
- 2 @keyframes @name {
4
- 3 50% {width: 20px;}
1
+ NameError: variable @name is undefined in {path}at-rules-undefined-var.less on line 2, column 12:
2
+ 1
3
+ 2 @keyframes @name {
4
+ 3 50% {width: 20px;}
@@ -1,4 +1,4 @@
1
- SyntaxError: error evaluating function `default`: it is currently only allowed in parametric mixin guards, in {path}css-guard-default-func.less on line 2, column 16:
2
- 1
3
- 2 selector when (default()) {
4
- 3 color: red;
1
+ SyntaxError: error evaluating function `default`: it is currently only allowed in parametric mixin guards, in {path}css-guard-default-func.less on line 2, column 16:
2
+ 1
3
+ 2 selector when (default()) {
4
+ 3 color: red;
@@ -1,4 +1,4 @@
1
- NameError: variable @b is undefined in {path}javascript-undefined-var.less on line 2, column 9:
2
- 1 .scope {
3
- 2 @a: `@{b}`;
4
- 3 }
1
+ NameError: variable @b is undefined in {path}javascript-undefined-var.less on line 2, column 9:
2
+ 1 .scope {
3
+ 2 @a: `@{b}`;
4
+ 3 }
@@ -1,4 +1,4 @@
1
- RuntimeError: Ambiguous use of `default()` found when matching for `.m(1, 2)` in {path}mixins-guards-default-func-1.less on line 8, column 5:
2
- 7 .m(1, 1);
3
- 8 .m(1, 2);
4
- 9 }
1
+ RuntimeError: Ambiguous use of `default()` found when matching for `.m(1, 2)` in {path}mixins-guards-default-func-1.less on line 8, column 5:
2
+ 7 .m(1, 1);
3
+ 8 .m(1, 2);
4
+ 9 }
@@ -1,4 +1,4 @@
1
- RuntimeError: Ambiguous use of `default()` found when matching for `.m(3)` in {path}mixins-guards-default-func-2.less on line 8, column 5:
2
- 7 .m(2);
3
- 8 .m(3);
4
- 9 }
1
+ RuntimeError: Ambiguous use of `default()` found when matching for `.m(3)` in {path}mixins-guards-default-func-2.less on line 8, column 5:
2
+ 7 .m(2);
3
+ 8 .m(3);
4
+ 9 }
@@ -1,4 +1,4 @@
1
- RuntimeError: Ambiguous use of `default()` found when matching for `.m(2)` in {path}mixins-guards-default-func-3.less on line 8, column 5:
2
- 7 .m(1);
3
- 8 .m(2);
4
- 9 }
1
+ RuntimeError: Ambiguous use of `default()` found when matching for `.m(2)` in {path}mixins-guards-default-func-3.less on line 8, column 5:
2
+ 7 .m(1);
3
+ 8 .m(2);
4
+ 9 }
@@ -1,3 +1,3 @@
1
- ParseError: media definitions require block statements after any features in {path}parse-error-media-no-block-1.less on line 1, column 24:
1
+ SyntaxError: media definitions require block statements after any features in {path}parse-error-media-no-block-1.less on line 1, column 24:
2
2
  1 @media (extra: bracket)) {
3
3
  2 body {
@@ -1,2 +1,2 @@
1
- ParseError: media definitions require block statements after any features in {path}parse-error-media-no-block-2.less on line 1, column 7:
1
+ SyntaxError: media definitions require block statements after any features in {path}parse-error-media-no-block-2.less on line 1, column 7:
2
2
  1 @media
@@ -1,3 +1,3 @@
1
- ParseError: media definitions require block statements after any features in {path}parse-error-media-no-block-3.less on line 4, column 4:
1
+ SyntaxError: media definitions require block statements after any features in {path}parse-error-media-no-block-3.less on line 4, column 4:
2
2
  3 font-size: 5000px;
3
3
  4 }
@@ -0,0 +1,3 @@
1
+ div {
2
+ percentage: percentage(16/17);
3
+ }
@@ -0,0 +1,4 @@
1
+ ArgumentError: error evaluating function `percentage`: argument must be a number in {path}percentage-non-number-argument.less on line 2, column 15:
2
+ 1 div {
3
+ 2 percentage: percentage(16/17);
4
+ 3 }
@@ -1,2 +1,2 @@
1
- NameError: variable @color is undefined in {path}property-interp-not-defined.less on line 1, column 12:
2
- 1 a {outline-@{color}: green}
1
+ NameError: variable @color is undefined in {path}property-interp-not-defined.less on line 1, column 12:
2
+ 1 a {outline-@{color}: green}
@@ -96,4 +96,15 @@ div.ext5,
96
96
  .footer-nav {
97
97
  &:extend( .header .header-nav all );
98
98
  }
99
- }
99
+ }
100
+
101
+ .issue-2586-bordered {
102
+ border: solid 1px black;
103
+ }
104
+ .issue-2586-somepage {
105
+ .content:extend(.issue-2586-bordered) {
106
+ &>span {
107
+ margin-bottom: 10px;
108
+ }
109
+ }
110
+ }
@@ -0,0 +1 @@
1
+ @import (inline) "invalid-css.less";
@@ -37,7 +37,7 @@
37
37
 
38
38
  .zz {
39
39
  .y {
40
- pulled-in: yes;
40
+ pulled-in: yes /* inline comment survives */;
41
41
  }
42
42
  /* comment pulled in */
43
43
  }
@@ -86,4 +86,13 @@
86
86
  }
87
87
  @rules1: {property: value;};
88
88
  @rules2: {property: value;};
89
+ }
90
+
91
+ @import (inline, multiple) "invalid-css.less";
92
+ @import "import-inline-invalid-css.less";
93
+ .print-referenced-import-inline() {
94
+ div {
95
+ @import (inline, multiple) "invalid-css.less";
96
+ }
97
+ @import (inline, multiple) "invalid-css.less";
89
98
  }
@@ -0,0 +1,6 @@
1
+ .container-no-parent-selector {
2
+ .mixin-no-parent-selector();
3
+ }
4
+ .container-with-parent-selector {
5
+ .mixin-with-parent-selector()
6
+ }
@@ -0,0 +1,13 @@
1
+ .theOnlySelector {
2
+ avoid: warning;
3
+ }
4
+ .unusedAndReference:extend(.theOnlySelector) {
5
+ unused-and: reference;
6
+ }
7
+
8
+ @import (reference) "global-scope-nested.less";
9
+
10
+ .test-b {
11
+ background-color: green;
12
+ &:extend(.test-a all);
13
+ }
@@ -0,0 +1,3 @@
1
+ .test-a {
2
+ color: red;
3
+ }
@@ -0,0 +1,8 @@
1
+ .mixin-no-parent-selector() {
2
+ background-color: red;
3
+ }
4
+ .mixin-with-parent-selector() {
5
+ &:first-child{ // USING AN & SELECTOR HERE
6
+ background-color: blue;
7
+ }
8
+ }
@@ -0,0 +1,12 @@
1
+ /* double nested file */
2
+ should {
3
+ be: invisible;
4
+ }
5
+ /* do not extend outside of this */
6
+ .something {
7
+ invisible: suppress warning;
8
+ }
9
+ .invisible {
10
+ &:extend(.something all);
11
+ }
12
+
@@ -0,0 +1,10 @@
1
+ /*
2
+ tralala
3
+ */
4
+ .fix {
5
+ fix: fix;
6
+ }
7
+ .something {
8
+ @import (reference) "multiple-import-nested.less";
9
+ inside: something;
10
+ }
@@ -0,0 +1,3 @@
1
+ .mixin {
2
+ was: included;
3
+ }
@@ -0,0 +1,3 @@
1
+ ruleset {
2
+ shall-be-invisible: less;
3
+ }
@@ -0,0 +1,50 @@
1
+ // Tests following past issues:
2
+ // * #1851 - Extend within (reference) imported files
3
+ // * #1896 - Namespace imported less code does not get properly referenced, when there's a (reference) keyword.
4
+ // * #1878 - extend inside referenced file should not extend outside selectors
5
+ // * #2716 - A file imported by reference and then normally - multiple imports should be independent
6
+ // * #1968 - When using an @import (reference), mixins that contain an & selector get added to the compiled output improperly
7
+ // * #2162 - Cannot put import by reference inside of a mixin (also doubles #1896)
8
+
9
+ // #1878: extend inside referenced file should not extend outside selectors
10
+ @import (reference) "import-reference-issues/global-scope-import.less";
11
+ .theOnlySelector {
12
+ shall-have: one selector;
13
+ }
14
+
15
+ // #2716: A file imported by reference and then normally - multiple imports should be independent
16
+ // #1878: - double nested version
17
+ #do-not-show-import {
18
+ @import (reference, multiple) "import-reference-issues/multiple-import.less";
19
+ }
20
+
21
+ show-all-content {
22
+ @import (multiple) "import-reference-issues/multiple-import.less";
23
+ }
24
+ // #1896: Namespace imported less code does not get properly referenced, when there's a (reference) keyword.
25
+ #Namespace {
26
+ @import (less, reference) "import-reference-issues/simple-mixin.css";
27
+ }
28
+ #used-namespaced-mixin {
29
+ #Namespace > .mixin();
30
+ shall-see: another property above;
31
+ }
32
+
33
+ // #1851: Extend within (reference) imported files
34
+ // test-b is in global-scope-import.less file
35
+ .test-c {
36
+ &:extend(.test-b all);
37
+ }
38
+
39
+ // #1968: When using an @import (reference), mixins that contain an & selector get added to the compiled output improperly
40
+ @import "import-reference-issues/mixin-1968.less";
41
+ @import (reference) "import-reference-issues/appender-reference-1968.less";
42
+
43
+ // #2162 - Cannot put import by reference inside of a mixin (also doubles #1896)
44
+ .mixin-with-import-by-reference-inside() {
45
+ the-only-property: nothing-below-this;
46
+ @import (reference) "import-reference-issues/simple-ruleset-2162.less";
47
+ }
48
+ call-mixin-with-import-by-reference-inside {
49
+ .mixin-with-import-by-reference-inside();
50
+ }
@@ -22,3 +22,5 @@
22
22
  }
23
23
  .mixin-with-nested-selectors();
24
24
  .mixin-with-directives(some-name);
25
+
26
+ .print-referenced-import-inline();
@@ -212,4 +212,52 @@ body {
212
212
 
213
213
  div {
214
214
  .test-calling-one-arg-mixin(1);
215
+ }
216
+
217
+ mixins-args-expand-op- {
218
+ @x: 1, 2, 3;
219
+ @y: 4 5 6;
220
+
221
+ &1 {.m3(@x...)}
222
+ &2 {.m3(@y...)}
223
+ &3 {.wr(a, b, c)}
224
+ &4 {.wr(a; b; c, d)}
225
+ &5 {.wr(@x...)}
226
+ &6 {.m4(0; @x...)}
227
+ &7 {.m4(@x..., @a: 0)}
228
+ &8 {.m4(@b: 1.5; @x...)}
229
+ &9 {.aa(@y, @x..., and again, @y...)}
230
+
231
+ .m3(@a, @b, @c) {
232
+ m3: @a, @b, @c;
233
+ }
234
+
235
+ .m4(@a, @b, @c, @d) {
236
+ m4: @a, @b, @c, @d;
237
+ }
238
+
239
+ .wr(@a...) {
240
+ &a {.m3(@a...)}
241
+ &b {.m4(0, @a...)}
242
+ &c {.m4(@a..., 4)}
243
+ }
244
+
245
+ .aa(@a...) {
246
+ aa: @a;
247
+ a4: extract(@a, 5);
248
+ a8: extract(@a, 8);
249
+ }
250
+ }
251
+ #test-mixin-matching-when-default-2645 {
252
+ .mixin(@height) {
253
+ height: @height;
254
+ }
255
+
256
+ .mixin(@width, @height: 10px) {
257
+ width: @width;
258
+
259
+ .mixin(@height: @height);
260
+ }
261
+
262
+ .mixin(@height: 20px);
215
263
  }
@@ -278,3 +278,81 @@
278
278
  .guarded-mixin-for-root() when (@guarded-mixin-for-root) {}
279
279
  }
280
280
  #ns > .guarded-mixin-for-root();
281
+ // various combinations of nested or, and, paranthesis and negation
282
+ .parenthesisNot(@value) when ((((@value)))) {
283
+ parenthesisNot: just-value;
284
+ }
285
+ .parenthesisNot(@value) when (((not(@value)))) {
286
+ parenthesisNot: negated once inside;
287
+ }
288
+ .parenthesisNot(@value) when not((((@value)))) {
289
+ parenthesisNot: negated once outside;
290
+ }
291
+ .parenthesisNot(@value) when ((not((@value)))) {
292
+ parenthesisNot: negated once middle;
293
+ }
294
+ .parenthesisNot(@value) when not(((not(@value)))) {
295
+ parenthesisNot: negated twice 1;
296
+ }
297
+ .parenthesisNot(@value) when (not((not(@value)))) {
298
+ parenthesisNot: negated twice 2;
299
+ }
300
+ .parenthesisNot(@value) when ((not(not(@value)))) {
301
+ parenthesisNot: negated twice 3;
302
+ }
303
+ .parenthesisNot (...) when (default()) {
304
+ parenthesisNot: none matched;
305
+ }
306
+
307
+ #parenthesisNot-true {
308
+ .parenthesisNot(true);
309
+ }
310
+ #parenthesisNot-false {
311
+ .parenthesisNot(false);
312
+ }
313
+
314
+ .orderOfEvaluation(@a1, @a2, @a3) when ((@a1) and (@a2) or (@a3)) {
315
+ no-parenthesis: evaluated true 1a;
316
+ }
317
+ .orderOfEvaluation(@a1, @a2, @a3) when ((@a3) or (@a1) and (@a2)) {
318
+ no-parenthesis: evaluated true 1b;
319
+ }
320
+ .orderOfEvaluation(@a1, @a2, @a3) when ((@a1) and ((@a2) or (@a3))) {
321
+ no-parenthesis: evaluated true 1c;
322
+ }
323
+ .orderOfEvaluation(@a1, @a2, @a3) when (@a3), (@a1) and (@a2) {
324
+ no-parenthesis: evaluated true 1d;
325
+ }
326
+ .orderOfEvaluation(@a1, @a2, @a3) when (((@a3) or (@a1)) and (@a2)) {
327
+ no-parenthesis: evaluated true 1e;
328
+ }
329
+ .orderOfEvaluation(@a1, @a2, @a3) when ((@a1) and (@a2) or not (@a3)) {
330
+ no-parenthesis: evaluated true 2a;
331
+ }
332
+ .orderOfEvaluation(@a1, @a2, @a3) when (not (@a3) or (@a1) and (@a2)) {
333
+ no-parenthesis: evaluated true 2b;
334
+ }
335
+ .orderOfEvaluation(@a1, @a2, @a3) when not (@a3), (@a1) and (@a2) {
336
+ no-parenthesis: evaluated true 2c;
337
+ }
338
+ .orderOfEvaluation(@a1, @a2, @a3) when (not (@a1) and (@a2) or (@a3)) {
339
+ no-parenthesis: evaluated true 3;
340
+ }
341
+ .orderOfEvaluation(@a1, @a2, @a3) when ((((@a1) and (@a2) or (@a3)))) {
342
+ no-parenthesis: evaluated true 4;
343
+ }
344
+ .orderOfEvaluation(@a1, @a2, @a3) when (((@a1) and (@a2)) or (@a3)) {
345
+ with-parenthesis: evaluated true;
346
+ }
347
+ .orderOfEvaluation(...) when (default()) {
348
+ orderOfEvaluation: evaluated false;
349
+ }
350
+ #orderOfEvaluation-false-false-true {
351
+ .orderOfEvaluation(false, false, true);
352
+ }
353
+ #orderOfEvaluation-false-false-false {
354
+ .orderOfEvaluation(false, false, false);
355
+ }
356
+ #orderOfEvaluation-true-true-false {
357
+ .orderOfEvaluation(true, true, false);
358
+ }
@@ -0,0 +1,25 @@
1
+ // https://github.com/less/less.js/issues/2798
2
+ .test-2798 when ((8+4) < 13) {
3
+ regression: fixed;
4
+ }
5
+ .test-2798 when ((8+6) < 13) {
6
+ regression: should not be visible;
7
+ }
8
+ .conditions-parser-1 when (8+4 < 13) {
9
+ only-atomic: ok;
10
+ }
11
+ .conditions-parser-1 when (8+6 < 13) {
12
+ only-atomic: should not be visible;
13
+ }
14
+ .conditions-parser-2 when (8+(5-1) < 13) {
15
+ only-atomic-with-nested-parenthesis: ok;
16
+ }
17
+ .conditions-parser-2 when (8+(15-1) < 13) {
18
+ only-atomic-with-nested-parenthesis: should not be visible;
19
+ }
20
+ .conditions-parser-3 when (8 < (13+1)) {
21
+ only-atomic-nested-parenthesis-on-right: ok;
22
+ }
23
+ .conditions-parser-3 when (8 < (3+1)) {
24
+ only-atomic-nested-parenthesis-on-right: should not be visible;
25
+ }
@@ -0,0 +1,10 @@
1
+ .named-colors-in-expressions {
2
+ color-0: 0 -red;
3
+ color-1: 1 - red;
4
+ color-2: red * 2;
5
+ color-3: 2 * red;
6
+ @3: -red;
7
+ &-bar@{3} {x: y}
8
+ @color: red;
9
+ &-bar@{color} {a: a}
10
+ }
@@ -1,5 +1,6 @@
1
1
  #operations {
2
2
  color: (#110000 + #000011 + #001100); // #111111
3
+ color-2: (yellow - #070707);
3
4
  height: (10px / 2px + 6px - 1px * 2); // 9px
4
5
  width: (2 * 4 - 5em); // 3em
5
6
  .spacing {
@@ -18,3 +18,14 @@
18
18
  @gutter-width * // We strongly recommend you */
19
19
  @columns); // do not change this formula. */
20
20
  @total-width : @gridsystem-width; // set to 100% for fluid grid */
21
+
22
+ // .............................................................................
23
+
24
+ .some-inline-comments {
25
+ a: yes /* comment */;
26
+ b: red /* comment */;
27
+ @c: yes /* comment */;
28
+ @d: red /* comment */;
29
+ c: @c;
30
+ d: @d;
31
+ }
@@ -144,11 +144,19 @@ body ^^ .shadow {
144
144
  #issue2066 {
145
145
  background: url('/images/icon-team.svg') 0 0 / contain;
146
146
  }
147
+
147
148
  @counter-style triangle {
148
149
  system: cyclic;
149
150
  symbols: ‣;
150
151
  suffix: " ";
151
152
  }
153
+
152
154
  @-ms-viewport{
153
- //width: auto !important;
154
- }
155
+ // width: auto !important;
156
+ }
157
+
158
+ @unknown foo 42 (bar) {
159
+ x {y: z}
160
+ }
161
+
162
+ @unknown foo 43;
@@ -1,4 +1,4 @@
1
- NameError: variable @name is undefined in {path}at-rules-undefined-var.less on line 2, column 12:
2
- 1
3
- 2 @keyframes @name {
4
- 3 50% {width: 20px;}
1
+ NameError: variable @name is undefined in {path}at-rules-undefined-var.less on line 2, column 12:
2
+ 1
3
+ 2 @keyframes @name {
4
+ 3 50% {width: 20px;}
@@ -1,4 +1,4 @@
1
- SyntaxError: error evaluating function `default`: it is currently only allowed in parametric mixin guards, in {path}css-guard-default-func.less on line 2, column 16:
2
- 1
3
- 2 selector when (default()) {
4
- 3 color: red;
1
+ SyntaxError: error evaluating function `default`: it is currently only allowed in parametric mixin guards, in {path}css-guard-default-func.less on line 2, column 16:
2
+ 1
3
+ 2 selector when (default()) {
4
+ 3 color: red;
@@ -1,4 +1,4 @@
1
- NameError: variable @b is undefined in {path}javascript-undefined-var.less on line 2, column 9:
2
- 1 .scope {
3
- 2 @a: `@{b}`;
4
- 3 }
1
+ NameError: variable @b is undefined in {path}javascript-undefined-var.less on line 2, column 9:
2
+ 1 .scope {
3
+ 2 @a: `@{b}`;
4
+ 3 }
@@ -1,4 +1,4 @@
1
- RuntimeError: Ambiguous use of `default()` found when matching for `.m(1, 2)` in {path}mixins-guards-default-func-1.less on line 8, column 5:
2
- 7 .m(1, 1);
3
- 8 .m(1, 2);
4
- 9 }
1
+ RuntimeError: Ambiguous use of `default()` found when matching for `.m(1, 2)` in {path}mixins-guards-default-func-1.less on line 8, column 5:
2
+ 7 .m(1, 1);
3
+ 8 .m(1, 2);
4
+ 9 }
@@ -1,4 +1,4 @@
1
- RuntimeError: Ambiguous use of `default()` found when matching for `.m(3)` in {path}mixins-guards-default-func-2.less on line 8, column 5:
2
- 7 .m(2);
3
- 8 .m(3);
4
- 9 }
1
+ RuntimeError: Ambiguous use of `default()` found when matching for `.m(3)` in {path}mixins-guards-default-func-2.less on line 8, column 5:
2
+ 7 .m(2);
3
+ 8 .m(3);
4
+ 9 }
@@ -1,4 +1,4 @@
1
- RuntimeError: Ambiguous use of `default()` found when matching for `.m(2)` in {path}mixins-guards-default-func-3.less on line 8, column 5:
2
- 7 .m(1);
3
- 8 .m(2);
4
- 9 }
1
+ RuntimeError: Ambiguous use of `default()` found when matching for `.m(2)` in {path}mixins-guards-default-func-3.less on line 8, column 5:
2
+ 7 .m(1);
3
+ 8 .m(2);
4
+ 9 }
@@ -1,3 +1,3 @@
1
- ParseError: media definitions require block statements after any features in {path}parse-error-media-no-block-1.less on line 1, column 24:
1
+ SyntaxError: media definitions require block statements after any features in {path}parse-error-media-no-block-1.less on line 1, column 24:
2
2
  1 @media (extra: bracket)) {
3
3
  2 body {
@@ -1,2 +1,2 @@
1
- ParseError: media definitions require block statements after any features in {path}parse-error-media-no-block-2.less on line 1, column 7:
1
+ SyntaxError: media definitions require block statements after any features in {path}parse-error-media-no-block-2.less on line 1, column 7:
2
2
  1 @media