less 3.6.0 → 3.8.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 (142) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/Gruntfile.js +43 -6
  3. package/bin/lessc +32 -3
  4. package/dist/less.js +2810 -326
  5. package/dist/less.min.js +7 -7
  6. package/lib/less/constants.js +13 -0
  7. package/lib/less/contexts.js +45 -10
  8. package/lib/less/default-options.js +12 -4
  9. package/lib/less/functions/color.js +84 -41
  10. package/lib/less/functions/data-uri.js +1 -1
  11. package/lib/less/functions/index.js +1 -0
  12. package/lib/less/functions/list.js +101 -0
  13. package/lib/less/functions/types.js +1 -19
  14. package/lib/less/import-manager.js +3 -3
  15. package/lib/less/index.js +1 -1
  16. package/lib/less/parse.js +3 -3
  17. package/lib/less/parser/parser.js +31 -13
  18. package/lib/less/render.js +2 -2
  19. package/lib/less/source-map-output.js +2 -2
  20. package/lib/less/tree/color.js +58 -18
  21. package/lib/less/tree/declaration.js +11 -7
  22. package/lib/less/tree/expression.js +7 -3
  23. package/lib/less/tree/import.js +9 -8
  24. package/lib/less/tree/mixin-definition.js +1 -1
  25. package/lib/less/tree/operation.js +10 -4
  26. package/lib/less/tree/url.js +12 -8
  27. package/lib/less/utils.js +54 -19
  28. package/lib/less-browser/add-default-options.js +3 -3
  29. package/lib/less-browser/index.js +9 -2
  30. package/lib/less-node/image-size.js +1 -1
  31. package/lib/less-node/lessc-helper.js +12 -4
  32. package/package.json +5 -2
  33. package/test/browser/css/rewrite-urls/urls.css +36 -0
  34. package/test/browser/css/rootpath-rewrite-urls/urls.css +35 -0
  35. package/test/browser/less/rewrite-urls/urls.less +34 -0
  36. package/test/browser/less/rootpath-rewrite-urls/urls.less +33 -0
  37. package/test/browser/less.js +2810 -326
  38. package/test/browser/runner-browser-options.js +1 -1
  39. package/test/browser/runner-errors-options.js +1 -1
  40. package/test/browser/runner-legacy-options.js +1 -1
  41. package/test/browser/runner-rewrite-urls-options.js +3 -0
  42. package/test/browser/runner-rewrite-urls-spec.js +3 -0
  43. package/test/browser/runner-rootpath-relative-spec.js +1 -1
  44. package/test/browser/runner-rootpath-rewrite-urls-options.js +4 -0
  45. package/test/browser/runner-rootpath-rewrite-urls-spec.js +3 -0
  46. package/test/css/calc.css +2 -2
  47. package/test/css/colors.css +20 -3
  48. package/test/css/css-3.css +0 -8
  49. package/test/css/css-escapes.css +3 -0
  50. package/test/css/functions-each.css +48 -0
  51. package/test/css/functions.css +6 -4
  52. package/test/css/math/parens-division/media-math.css +10 -0
  53. package/test/css/math/parens-division/mixins-args.css +169 -0
  54. package/test/css/math/parens-division/new-division.css +16 -0
  55. package/test/css/math/parens-division/parens.css +37 -0
  56. package/test/css/math/strict/css.css +95 -0
  57. package/test/css/math/strict/media-math.css +10 -0
  58. package/test/css/math/strict/mixins-args.css +169 -0
  59. package/test/css/math/strict/parens.css +37 -0
  60. package/test/css/{strict-math → math/strict-legacy}/css.css +0 -0
  61. package/test/css/math/strict-legacy/media-math.css +10 -0
  62. package/test/css/{strict-math → math/strict-legacy}/mixins-args.css +0 -0
  63. package/test/css/{strict-math → math/strict-legacy}/parens.css +5 -1
  64. package/test/css/no-strict-math/no-sm-operations.css +3 -0
  65. package/test/css/rewrite-urls-all/rewrite-urls-all.css +17 -0
  66. package/test/css/rewrite-urls-local/rewrite-urls-local.css +17 -0
  67. package/test/css/rootpath-rewrite-urls-all/rootpath-rewrite-urls-all.css +17 -0
  68. package/test/css/rootpath-rewrite-urls-local/rootpath-rewrite-urls-local.css +17 -0
  69. package/test/css/static-urls/urls.css +2 -2
  70. package/test/css/urls.css +2 -2
  71. package/test/index.js +28 -15
  72. package/test/less/colors.less +18 -0
  73. package/test/less/css-3.less +0 -9
  74. package/test/less/css-escapes.less +4 -0
  75. package/test/less/errors/color-func-invalid-color.txt +1 -1
  76. package/test/less/errors/mixin-not-defined-2.less +7 -0
  77. package/test/less/errors/mixin-not-defined-2.txt +4 -0
  78. package/test/less/functions-each.less +81 -0
  79. package/test/less/functions.less +14 -2
  80. package/test/less/math/parens-division/media-math.less +9 -0
  81. package/test/less/math/parens-division/mixins-args.less +264 -0
  82. package/test/less/math/parens-division/new-division.less +17 -0
  83. package/test/less/{strict-math → math/parens-division}/parens.less +2 -1
  84. package/test/less/math/strict/css.less +108 -0
  85. package/test/less/math/strict/media-math.less +9 -0
  86. package/test/less/math/strict/mixins-args.less +264 -0
  87. package/test/less/math/strict/parens.less +46 -0
  88. package/test/less/{strict-math → math/strict-legacy}/css.less +0 -0
  89. package/test/less/math/strict-legacy/media-math.less +9 -0
  90. package/test/less/{strict-math → math/strict-legacy}/mixins-args.less +0 -0
  91. package/test/less/math/strict-legacy/parens.less +50 -0
  92. package/test/less/no-strict-math/no-sm-operations.less +3 -0
  93. package/test/less/rewrite-urls-all/folder/file.less +8 -0
  94. package/test/less/rewrite-urls-all/rewrite-urls-all.less +11 -0
  95. package/test/less/rewrite-urls-local/folder/file.less +8 -0
  96. package/test/less/rewrite-urls-local/rewrite-urls-local.less +11 -0
  97. package/test/less/rootpath-rewrite-urls-all/folder/file.less +8 -0
  98. package/test/less/rootpath-rewrite-urls-all/rootpath-rewrite-urls-all.less +11 -0
  99. package/test/less/rootpath-rewrite-urls-local/folder/file.less +8 -0
  100. package/test/less/rootpath-rewrite-urls-local/rootpath-rewrite-urls-local.less +11 -0
  101. package/test/less/sourcemaps/custom-props.less +8 -0
  102. package/test/less-bom/colors.less +18 -0
  103. package/test/less-bom/css-3.less +0 -9
  104. package/test/less-bom/css-escapes.less +4 -0
  105. package/test/less-bom/errors/color-func-invalid-color.txt +1 -1
  106. package/test/less-bom/errors/mixin-not-defined-2.less +7 -0
  107. package/test/less-bom/errors/mixin-not-defined-2.txt +4 -0
  108. package/test/less-bom/functions-each.less +81 -0
  109. package/test/less-bom/functions.less +14 -2
  110. package/test/less-bom/math/parens-division/media-math.less +9 -0
  111. package/test/less-bom/math/parens-division/mixins-args.less +264 -0
  112. package/test/less-bom/math/parens-division/new-division.less +17 -0
  113. package/test/less-bom/{strict-math → math/parens-division}/parens.less +2 -1
  114. package/test/less-bom/math/strict/css.less +108 -0
  115. package/test/less-bom/math/strict/media-math.less +9 -0
  116. package/test/less-bom/math/strict/mixins-args.less +264 -0
  117. package/test/less-bom/math/strict/parens.less +46 -0
  118. package/test/less-bom/{strict-math → math/strict-legacy}/css.less +0 -0
  119. package/test/less-bom/math/strict-legacy/media-math.less +9 -0
  120. package/test/less-bom/{strict-math → math/strict-legacy}/mixins-args.less +0 -0
  121. package/test/less-bom/math/strict-legacy/parens.less +50 -0
  122. package/test/less-bom/no-strict-math/no-sm-operations.less +3 -0
  123. package/test/less-bom/rewrite-urls-all/folder/file.less +8 -0
  124. package/test/less-bom/rewrite-urls-all/rewrite-urls-all.less +11 -0
  125. package/test/less-bom/rewrite-urls-local/folder/file.less +8 -0
  126. package/test/less-bom/rewrite-urls-local/rewrite-urls-local.less +11 -0
  127. package/test/less-bom/rootpath-rewrite-urls-all/folder/file.less +8 -0
  128. package/test/less-bom/rootpath-rewrite-urls-all/rootpath-rewrite-urls-all.less +11 -0
  129. package/test/less-bom/rootpath-rewrite-urls-local/folder/file.less +8 -0
  130. package/test/less-bom/rootpath-rewrite-urls-local/rootpath-rewrite-urls-local.less +11 -0
  131. package/test/less-bom/sourcemaps/custom-props.less +8 -0
  132. package/test/less-test.js +26 -12
  133. package/test/sourcemaps/custom-props.json +1 -0
  134. package/.npmignore +0 -8
  135. package/test/less/errors/color-invalid-hex-code.less +0 -4
  136. package/test/less/errors/color-invalid-hex-code.txt +0 -4
  137. package/test/less/errors/color-invalid-hex-code2.less +0 -4
  138. package/test/less/errors/color-invalid-hex-code2.txt +0 -4
  139. package/test/less-bom/errors/color-invalid-hex-code.less +0 -4
  140. package/test/less-bom/errors/color-invalid-hex-code.txt +0 -4
  141. package/test/less-bom/errors/color-invalid-hex-code2.less +0 -4
  142. package/test/less-bom/errors/color-invalid-hex-code2.txt +0 -4
@@ -0,0 +1,169 @@
1
+ #hidden {
2
+ color: transparent;
3
+ }
4
+ #hidden1 {
5
+ color: transparent;
6
+ }
7
+ .two-args {
8
+ color: blue;
9
+ width: 10px;
10
+ height: 99%;
11
+ depth: 100% - 1%;
12
+ border: 2px dotted black;
13
+ }
14
+ .one-arg {
15
+ width: 15px;
16
+ height: 49%;
17
+ depth: 50% - 1%;
18
+ }
19
+ .no-parens {
20
+ width: 5px;
21
+ height: 49%;
22
+ depth: 50% - 1%;
23
+ }
24
+ .no-args {
25
+ width: 5px;
26
+ height: 49%;
27
+ depth: 50% - 1%;
28
+ }
29
+ .var-args {
30
+ width: 45;
31
+ height: 8%;
32
+ depth: 18 / 2 - 1%;
33
+ }
34
+ .multi-mix {
35
+ width: 10px;
36
+ height: 29%;
37
+ depth: 30% - 1%;
38
+ margin: 4;
39
+ padding: 5;
40
+ }
41
+ body {
42
+ padding: 30px;
43
+ color: #f00;
44
+ }
45
+ .scope-mix {
46
+ width: 8;
47
+ }
48
+ .content {
49
+ width: 600px;
50
+ }
51
+ .content .column {
52
+ margin: 600px;
53
+ }
54
+ #same-var-name {
55
+ radius: 5px;
56
+ }
57
+ #var-inside {
58
+ width: 10px;
59
+ }
60
+ .arguments {
61
+ border: 1px solid black;
62
+ width: 1px;
63
+ }
64
+ .arguments2 {
65
+ border: 0px;
66
+ width: 0px;
67
+ }
68
+ .arguments3 {
69
+ border: 0px;
70
+ width: 0px;
71
+ }
72
+ .arguments4 {
73
+ border: 0 1 2 3 4;
74
+ rest: 1 2 3 4;
75
+ width: 0;
76
+ }
77
+ .edge-case {
78
+ border: "{";
79
+ width: "{";
80
+ }
81
+ .slash-vs-math {
82
+ border-radius: 2px/5px;
83
+ border-radius: 5px/10px;
84
+ border-radius: 6px;
85
+ }
86
+ .comma-vs-semi-colon {
87
+ one: a;
88
+ two: b, c;
89
+ one: d, e;
90
+ two: f;
91
+ one: g;
92
+ one: h;
93
+ one: i;
94
+ one: j;
95
+ one: k;
96
+ two: l;
97
+ one: m, n;
98
+ one: o, p;
99
+ two: q;
100
+ one: r, s;
101
+ two: t;
102
+ }
103
+ #named-conflict {
104
+ four: a, 11, 12, 13;
105
+ four: a, 21, 22, 23;
106
+ }
107
+ .test-mixin-default-arg {
108
+ defaults: 1px 1px 1px;
109
+ defaults: 2px 2px 2px;
110
+ }
111
+ .selector {
112
+ margin: 2, 2, 2, 2;
113
+ }
114
+ .selector2 {
115
+ margin: 2, 2, 2, 2;
116
+ }
117
+ .selector3 {
118
+ margin: 4;
119
+ }
120
+ mixins-args-expand-op-1 {
121
+ m3: 1, 2, 3;
122
+ }
123
+ mixins-args-expand-op-2 {
124
+ m3: 4, 5, 6;
125
+ }
126
+ mixins-args-expand-op-3a {
127
+ m3: a, b, c;
128
+ }
129
+ mixins-args-expand-op-3b {
130
+ m4: 0, a, b, c;
131
+ }
132
+ mixins-args-expand-op-3c {
133
+ m4: a, b, c, 4;
134
+ }
135
+ mixins-args-expand-op-4a {
136
+ m3: a, b, c, d;
137
+ }
138
+ mixins-args-expand-op-4b {
139
+ m4: 0, a, b, c, d;
140
+ }
141
+ mixins-args-expand-op-4c {
142
+ m4: a, b, c, d, 4;
143
+ }
144
+ mixins-args-expand-op-5a {
145
+ m3: 1, 2, 3;
146
+ }
147
+ mixins-args-expand-op-5b {
148
+ m4: 0, 1, 2, 3;
149
+ }
150
+ mixins-args-expand-op-5c {
151
+ m4: 1, 2, 3, 4;
152
+ }
153
+ mixins-args-expand-op-6 {
154
+ m4: 0, 1, 2, 3;
155
+ }
156
+ mixins-args-expand-op-7 {
157
+ m4: 0, 1, 2, 3;
158
+ }
159
+ mixins-args-expand-op-8 {
160
+ m4: 1, 1.5, 2, 3;
161
+ }
162
+ mixins-args-expand-op-9 {
163
+ aa: 4 5 6 1 2 3 and again 4 5 6;
164
+ a4: and;
165
+ a8: 5;
166
+ }
167
+ #test-mixin-matching-when-default-2645 {
168
+ height: 20px;
169
+ }
@@ -0,0 +1,37 @@
1
+ .parens {
2
+ border: 2px solid black;
3
+ margin: 1px 3px 16 3;
4
+ width: 36;
5
+ padding: 2px 36px;
6
+ }
7
+ .more-parens {
8
+ padding: 8 4 4 4px;
9
+ width-all: 96;
10
+ width-first: 16 * 6;
11
+ width-keep: 16 * 6;
12
+ height: calc(100% + (25vh - 20px));
13
+ height-keep: 49 + 64;
14
+ height-all: 113;
15
+ height-parts: 49 + 64;
16
+ margin-keep: 20 - 8;
17
+ margin-parts: 20 - 8;
18
+ margin-all: 12;
19
+ border-radius-keep: 4px * 2 / 4 + 3px;
20
+ border-radius-parts: 8px / 7px;
21
+ border-radius-all: 5px;
22
+ }
23
+ .negative {
24
+ neg-var: -1;
25
+ neg-var-paren: -1;
26
+ }
27
+ .nested-parens {
28
+ width: 2 * 36 - 1;
29
+ height: 5 + 1;
30
+ }
31
+ .mixed-units {
32
+ margin: 2px 4em 1 5pc;
33
+ padding: 6px 1em 2px 2;
34
+ }
35
+ .test-false-negatives {
36
+ a: (;
37
+ }
@@ -0,0 +1,10 @@
1
+ @media (min-width: 16 + 1) {
2
+ .foo {
3
+ bar: 1;
4
+ }
5
+ }
6
+ @media (min-width: 16 / 9) {
7
+ .foo {
8
+ bar: 1;
9
+ }
10
+ }
@@ -4,11 +4,15 @@
4
4
  width: 36;
5
5
  padding: 2px 36px;
6
6
  }
7
+ .in-function {
8
+ value: 2 + 1;
9
+ }
7
10
  .more-parens {
8
11
  padding: 8 4 4 4px;
9
12
  width-all: 96;
10
13
  width-first: 16 * 6;
11
14
  width-keep: (4 * 4) * 6;
15
+ height: calc(100% + (25vh - 20px));
12
16
  height-keep: (7 * 7) + (8 * 8);
13
17
  height-all: 113;
14
18
  height-parts: 49 + 64;
@@ -21,7 +25,7 @@
21
25
  }
22
26
  .negative {
23
27
  neg-var: -1;
24
- neg-var-paren: -(1);
28
+ neg-var-paren: -1;
25
29
  }
26
30
  .nested-parens {
27
31
  width: 2 * (4 * (2 + (1 + 6))) - 1;
@@ -13,3 +13,6 @@
13
13
  .named-colors-in-expressions-barred {
14
14
  a: a;
15
15
  }
16
+ .division {
17
+ value: 2px;
18
+ }
@@ -0,0 +1,17 @@
1
+ #imported-file {
2
+ background-image: url("./folder/relative/path");
3
+ background-image: url("./relative/path");
4
+ background-image: url("../relative/path");
5
+ background-image: url("folder/module");
6
+ background-image: url("folder/module/path");
7
+ background-image: url("folder/module/relative/path");
8
+ }
9
+ #rewrite-urls-all {
10
+ background-image: url("./relative/path");
11
+ background-image: url("../relative/path");
12
+ background-image: url("./path");
13
+ background-image: url("./");
14
+ background-image: url("module");
15
+ background-image: url("module/path");
16
+ background-image: url("module/relative/path");
17
+ }
@@ -0,0 +1,17 @@
1
+ #imported-file {
2
+ background-image: url("./folder/relative/path");
3
+ background-image: url("./relative/path");
4
+ background-image: url("../relative/path");
5
+ background-image: url("module");
6
+ background-image: url("module/path");
7
+ background-image: url("module/relative/path");
8
+ }
9
+ #rewrite-urls-local {
10
+ background-image: url("./relative/path");
11
+ background-image: url("../relative/path");
12
+ background-image: url("./path");
13
+ background-image: url("./");
14
+ background-image: url("module");
15
+ background-image: url("module/path");
16
+ background-image: url("module/relative/path");
17
+ }
@@ -0,0 +1,17 @@
1
+ #imported-file {
2
+ background-image: url("http://example.com/assets/css/folder/relative/path");
3
+ background-image: url("http://example.com/assets/css/relative/path");
4
+ background-image: url("http://example.com/assets/relative/path");
5
+ background-image: url("http://example.com/assets/css/folder/module");
6
+ background-image: url("http://example.com/assets/css/folder/module/path");
7
+ background-image: url("http://example.com/assets/css/folder/module/relative/path");
8
+ }
9
+ #rootpath-rewrite-urls-all {
10
+ background-image: url("http://example.com/assets/css/relative/path");
11
+ background-image: url("http://example.com/assets/relative/path");
12
+ background-image: url("http://example.com/assets/css/path");
13
+ background-image: url("http://example.com/assets/css");
14
+ background-image: url("http://example.com/assets/css/module");
15
+ background-image: url("http://example.com/assets/css/module/path");
16
+ background-image: url("http://example.com/assets/css/module/relative/path");
17
+ }
@@ -0,0 +1,17 @@
1
+ #imported-file {
2
+ background-image: url("http://example.com/assets/css/folder/relative/path");
3
+ background-image: url("http://example.com/assets/css/relative/path");
4
+ background-image: url("http://example.com/assets/relative/path");
5
+ background-image: url("module");
6
+ background-image: url("module/path");
7
+ background-image: url("module/relative/path");
8
+ }
9
+ #rootpath-rewrite-urls-local {
10
+ background-image: url("http://example.com/assets/css/relative/path");
11
+ background-image: url("http://example.com/assets/relative/path");
12
+ background-image: url("http://example.com/assets/css/path");
13
+ background-image: url("http://example.com/assets/css");
14
+ background-image: url("module");
15
+ background-image: url("module/path");
16
+ background-image: url("module/relative/path");
17
+ }
@@ -30,12 +30,12 @@
30
30
  #logo {
31
31
  width: 100px;
32
32
  height: 100px;
33
- background: url('assets/logo.png');
33
+ background: url('./assets/logo.png');
34
34
  background: url("#inline-svg");
35
35
  }
36
36
  @font-face {
37
37
  font-family: xecret;
38
- src: url('assets/xecret.ttf');
38
+ src: url('./assets/xecret.ttf');
39
39
  }
40
40
  #secret {
41
41
  font-family: xecret, sans-serif;
package/test/css/urls.css CHANGED
@@ -38,12 +38,12 @@
38
38
  #logo {
39
39
  width: 100px;
40
40
  height: 100px;
41
- background: url('import/assets/logo.png');
41
+ background: url('./import/assets/logo.png');
42
42
  background: url("#inline-svg");
43
43
  }
44
44
  @font-face {
45
45
  font-family: xecret;
46
- src: url('import/assets/xecret.ttf');
46
+ src: url('./import/assets/xecret.ttf');
47
47
  }
48
48
  #secret {
49
49
  font-family: xecret, sans-serif;
package/test/index.js CHANGED
@@ -9,32 +9,41 @@ lessTester.prepBomTest();
9
9
  var testMap = [
10
10
  [{}, 'namespacing/'],
11
11
  [{
12
- strictMath: false,
13
- relativeUrls: true,
14
- silent: true,
12
+ // TODO: Change this to rewriteUrls: 'all' once the relativeUrls option is removed
13
+ relativeUrls: true,
14
+ silent: true,
15
15
  javascriptEnabled: true,
16
16
  // Set explicitly for legacy tests for >3.0
17
17
  ieCompat: true
18
18
  }],
19
19
  [{
20
- strictMath: true,
20
+ math: 'strict-legacy',
21
21
  ieCompat: true
22
- }, 'strict-math/'],
22
+ }, 'math/strict-legacy/'],
23
+ [{
24
+ math: 'parens'
25
+ }, 'math/strict/'],
26
+ [{
27
+ math: 'parens-division'
28
+ }, 'math/parens-division/'],
29
+ // Use legacy strictMath: true here to demonstrate it still works
23
30
  [{strictMath: true, strictUnits: true, javascriptEnabled: true}, 'errors/',
24
31
  lessTester.testErrors, null],
25
- [{strictMath: true, strictUnits: true, javascriptEnabled: false}, 'no-js-errors/',
32
+
33
+ [{math: 'strict', strictUnits: true, javascriptEnabled: false}, 'no-js-errors/',
26
34
  lessTester.testErrors, null],
27
- [{strictMath: true, dumpLineNumbers: 'comments'}, 'debug/', null,
35
+ [{math: 'strict', dumpLineNumbers: 'comments'}, 'debug/', null,
28
36
  function(name) { return name + '-comments'; }],
29
- [{strictMath: true, dumpLineNumbers: 'mediaquery'}, 'debug/', null,
37
+ [{math: 'strict', dumpLineNumbers: 'mediaquery'}, 'debug/', null,
30
38
  function(name) { return name + '-mediaquery'; }],
31
- [{strictMath: true, dumpLineNumbers: 'all'}, 'debug/', null,
39
+ [{math: 'strict', dumpLineNumbers: 'all'}, 'debug/', null,
32
40
  function(name) { return name + '-all'; }],
33
- [{strictMath: true, relativeUrls: false, rootpath: 'folder (1)/'}, 'static-urls/'],
34
- [{strictMath: true, compress: true}, 'compression/'],
35
- [{strictMath: false, strictUnits: true}, 'strict-units/'],
41
+ // TODO: Change this to rewriteUrls: false once the relativeUrls option is removed
42
+ [{math: 'strict', relativeUrls: false, rootpath: 'folder (1)/'}, 'static-urls/'],
43
+ [{math: 'strict', compress: true}, 'compression/'],
44
+ [{math: 0, strictUnits: true}, 'strict-units/'],
36
45
  [{}, 'legacy/'],
37
- [{strictMath: true, strictUnits: true, sourceMap: true, globalVars: true }, 'sourcemaps/',
46
+ [{math: 'strict', strictUnits: true, sourceMap: true, globalVars: true }, 'sourcemaps/',
38
47
  lessTester.testSourcemap, null, null,
39
48
  function(filename, type, baseFolder) {
40
49
  if (type === 'vars') {
@@ -42,13 +51,17 @@ var testMap = [
42
51
  }
43
52
  return path.join('test/sourcemaps', filename) + '.json';
44
53
  }],
45
- [{strictMath: true, strictUnits: true, sourceMap: {sourceMapFileInline: true}},
54
+ [{math: 'strict', strictUnits: true, sourceMap: {sourceMapFileInline: true}},
46
55
  'sourcemaps-empty/', lessTester.testEmptySourcemap],
47
56
  [{globalVars: true, banner: '/**\n * Test\n */\n'}, 'globalVars/',
48
57
  null, null, null, function(name, type, baseFolder) { return path.join(baseFolder, name) + '.json'; }],
49
58
  [{modifyVars: true}, 'modifyVars/',
50
59
  null, null, null, function(name, type, baseFolder) { return path.join(baseFolder, name) + '.json'; }],
51
60
  [{urlArgs: '424242'}, 'url-args/'],
61
+ [{rewriteUrls: 'all'}, 'rewrite-urls-all/'],
62
+ [{rewriteUrls: 'local'}, 'rewrite-urls-local/'],
63
+ [{rootpath: 'http://example.com/assets/css/', rewriteUrls: 'all'}, 'rootpath-rewrite-urls-all/'],
64
+ [{rootpath: 'http://example.com/assets/css/', rewriteUrls: 'local'}, 'rootpath-rewrite-urls-local/'],
52
65
  [{paths: ['test/data/', 'test/less/import/']}, 'include-path/'],
53
66
  [{paths: 'test/data/'}, 'include-path-string/'],
54
67
  [{plugin: 'test/plugins/postprocess/'}, 'postProcessorPlugin/'],
@@ -62,7 +75,7 @@ testMap.forEach(function(args) {
62
75
  lessTester.runTestSet.apply(lessTester, args)
63
76
  });
64
77
  lessTester.testSyncronous({syncImport: true}, 'import');
65
- lessTester.testSyncronous({syncImport: true}, 'strict-math/css');
78
+ lessTester.testSyncronous({syncImport: true}, 'math/strict-legacy/css');
66
79
  lessTester.testNoOptions();
67
80
  lessTester.testJSImport();
68
81
  lessTester.finished();
@@ -96,3 +96,21 @@
96
96
  color: red(rgb(100%, 0, 0));
97
97
  border-color: rgba(100%, 0, 0, 50%);
98
98
  }
99
+
100
+ #rrggbbaa {
101
+ test-1: #55FF5599;
102
+ test-2: #5F59;
103
+ test-3: lighten(#55FF5599, 10%);
104
+ test-4: fade(#5F59, 10%);
105
+ test-5: rgba(#55FF5599);
106
+ test-6: rgba(#5F59);
107
+ test-7: rgba(#5F59, 0.5);
108
+ test-8: rgba(var(--color-accent), 0.2);
109
+ test-9: rgb(var(--color-accent));
110
+ test-9: hsla(var(--color-accent));
111
+ test-10: color('#55FF5599');
112
+ test-11: hsla(#5F59);
113
+ test-12: hsla(#5F59, 0.5);
114
+ --semi-transparent-dark-background: #001e00ee;
115
+ --semi-transparent-dark-background-2: rgba(0, 30, 0, 238); // invalid opacity will be capped
116
+ }
@@ -79,15 +79,6 @@ p::before {
79
79
  }
80
80
  }
81
81
 
82
- .units {
83
- font: 1.2rem/2rem;
84
- font: 8vw/9vw;
85
- font: 10vh/12vh;
86
- font: 12vm/15vm;
87
- font: 12vmin/15vmin;
88
- font: 1.2ch/1.5ch;
89
- }
90
-
91
82
  @supports ( box-shadow: 2px 2px 2px black ) or
92
83
  ( -moz-box-shadow: 2px 2px 2px black ) {
93
84
  .outline {
@@ -35,4 +35,8 @@ ng\:form {
35
35
  // In Bootstrap v3
36
36
  .bootstrap {
37
37
  background-color: #000 \9;
38
+ }
39
+
40
+ textarea {
41
+ font-family: 'helvetica neue','wenquanyi micro hei',\5FAE\8F6F\96C5\9ED1, \5B8B\4F53, sans-serif;
38
42
  }
@@ -1,4 +1,4 @@
1
- ArgumentError: error evaluating function `color`: argument must be a color keyword or 3/6 digit hex e.g. #FFF in {path}color-func-invalid-color.less on line 2, column 10:
1
+ ArgumentError: error evaluating function `color`: argument must be a color keyword or 3|4|6|8 digit hex e.g. #FFF in {path}color-func-invalid-color.less on line 2, column 10:
2
2
  1 .test {
3
3
  2 color: color("NOT A COLOR");
4
4
  3 }
@@ -0,0 +1,7 @@
1
+ .non-matching-mixin(@a @b) {
2
+ args: @a @b;
3
+ }
4
+
5
+ x {
6
+ .non-matching-mixin(x, y);
7
+ }
@@ -0,0 +1,4 @@
1
+ RuntimeError: No matching definition was found for `.non-matching-mixin(x, y)` in {path}mixin-not-defined-2.less on line 6, column 3:
2
+ 5 x {
3
+ 6 .non-matching-mixin(x, y);
4
+ 7 }
@@ -0,0 +1,81 @@
1
+ @selectors: blue, green, red;
2
+ @list: a b c d;
3
+
4
+ each(@selectors, {
5
+ .sel-@{value} {
6
+ a: b;
7
+ }
8
+ });
9
+
10
+ .each {
11
+ each(@list, {
12
+ index+: @index;
13
+ item@{index}: @value;
14
+ });
15
+
16
+ // nested each
17
+ each(10px 15px, 20px 25px; {
18
+ // demonstrates nesting of each()
19
+ each(@value; #(@v, @k, @i) {
20
+ nest-@{i}-@{index}: @v @k;
21
+ });
22
+ });
23
+
24
+ // nested anonymous mixin
25
+ .nest-anon {
26
+ each(a b, .(@v;@i) {
27
+ each(c d, .(@vv;@ii) {
28
+ nest-@{i}-@{ii}: @v @vv;
29
+ });
30
+ });
31
+ }
32
+
33
+ // vector math
34
+ each(1 2 3 4, {
35
+ padding+_: (@value * 10px);
36
+ });
37
+ }
38
+
39
+ @set: {
40
+ one: blue;
41
+ two: green;
42
+ three: red;
43
+ }
44
+ .set {
45
+ each(@set, {
46
+ @{key}: @value;
47
+ });
48
+ }
49
+ .set-2() {
50
+ one: blue;
51
+ two: green;
52
+ three: red;
53
+ }
54
+ .set-2 {
55
+ each(.set-2(), .(@v, @k, @i) {
56
+ @{k}-@{i}: @v;
57
+ });
58
+ }
59
+
60
+ .pick(@a) when (@a = 4) {
61
+ val3: @a;
62
+ }
63
+ .single {
64
+ each(true, {
65
+ val: @value;
66
+ });
67
+ @exp: 1 + 1;
68
+ each(@exp, {
69
+ val2: @value;
70
+ });
71
+ each(1 2 3 4, {
72
+ .pick(@value);
73
+ });
74
+ }
75
+
76
+ @list: a b c d;
77
+ .box {
78
+ each(@list, {
79
+ -less-log: extract(@list, @index);
80
+ })
81
+ }
@@ -257,11 +257,23 @@ html {
257
257
  e: if(not(true), 5);
258
258
  @f: boolean(3 = 4);
259
259
  f: if(not(@f), 6);
260
- g: if(2 > 1, 3, 5);
260
+ g: if(true, 3, 5);
261
261
  h: if(false, 3, 5);
262
262
  i: if(true and isnumber(6), 6, 8);
263
263
  j: if(not(true) and true, 6, 8);
264
264
  k: if(true or true, 1);
265
265
 
266
- if(false, {g: 7}); /* results in void */
266
+ if((false), {g: 7}); /* results in void */
267
+
268
+ @conditional: if((true), {
269
+ color: green;
270
+ }, {});
271
+ @conditional();
272
+
273
+ @falsey: if((false), {
274
+ color: orange;
275
+ }, {
276
+ color: purple;
277
+ });
278
+ @falsey();
267
279
  }
@@ -0,0 +1,9 @@
1
+ @var: 16;
2
+
3
+ @media (min-width: @var + 1) {
4
+ .foo { bar: 1; }
5
+ }
6
+
7
+ @media (min-width: @var / 9) {
8
+ .foo { bar: 1; }
9
+ }