@less/test-data 4.9.0 → 5.0.0-alpha.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 (204) hide show
  1. package/UPSTREAM-FIXTURE-SYNC.md +54 -0
  2. package/package.json +4 -1
  3. package/styles.config.ts +15 -0
  4. package/tests-config/3rd-party/styles.config.cjs +1 -1
  5. package/tests-config/compression/styles.config.cjs +1 -1
  6. package/tests-config/debug/all/styles.config.cjs +1 -1
  7. package/tests-config/debug/comments/styles.config.cjs +1 -1
  8. package/tests-config/debug/mediaquery/styles.config.cjs +1 -1
  9. package/tests-config/filemanagerPlugin/styles.config.cjs +1 -1
  10. package/tests-config/functions-harness/functions-harness.css +8 -0
  11. package/tests-config/functions-harness/functions-harness.less +10 -0
  12. package/tests-config/js-type-errors/js-type-error-2.txt +4 -0
  13. package/tests-config/js-type-errors/js-type-error.txt +1 -1
  14. package/tests-config/namespacing/legacy/namespacing-7.css +15 -0
  15. package/tests-config/namespacing/namespacing-5.less +3 -3
  16. package/tests-config/namespacing/namespacing-7.css +16 -8
  17. package/tests-config/namespacing/styles.config.cjs +4 -1
  18. package/tests-config/sourcemaps/styles.config.cjs +1 -1
  19. package/tests-config/sourcemaps-variable-selector/styles.config.cjs +1 -1
  20. package/tests-config/strict-imports/legacy/strict-imports.css +14 -0
  21. package/tests-config/strict-imports/strict-imports.css +4 -2
  22. package/tests-config/strict-imports/styles.config.cjs +6 -5
  23. package/tests-error/eval/ampersand-merge-template-invalid.less +7 -0
  24. package/tests-error/eval/ampersand-merge-template-invalid.txt +1 -0
  25. package/tests-error/eval/at-rules-undefined-var.less +1 -1
  26. package/tests-error/eval/property-undefined.txt +1 -0
  27. package/tests-error/eval/recursive-property.txt +1 -0
  28. package/tests-unit/at-rule-variable-deprecated/at-rule-variable-deprecated.css +0 -38
  29. package/tests-unit/at-rule-variable-deprecated/at-rule-variable-deprecated.less +0 -70
  30. package/tests-unit/at-rule-variable-interpolation/at-rule-variable-interpolation.css +45 -0
  31. package/tests-unit/at-rule-variable-interpolation/at-rule-variable-interpolation.less +72 -0
  32. package/tests-unit/at-rules/at-rules.css +8 -6
  33. package/tests-unit/at-rules/legacy/at-rules.css +110 -0
  34. package/tests-unit/at-rules/styles.config.ts +5 -0
  35. package/tests-unit/at-rules-bubbling/at-rules-bubbling.css +121 -0
  36. package/tests-unit/at-rules-bubbling/legacy/at-rules-bubbling.css +122 -0
  37. package/tests-unit/at-rules-keyword-comments/at-rules-keyword-comments.css +2 -5
  38. package/tests-unit/at-rules-keyword-comments/legacy/at-rules-keyword-comments.css +12 -0
  39. package/tests-unit/at-rules-targeted/at-rules-targeted.css +5 -3
  40. package/tests-unit/at-rules-targeted/legacy/at-rules-targeted.css +55 -0
  41. package/tests-unit/calc/calc.css +8 -8
  42. package/tests-unit/calc/calc.less +1 -0
  43. package/tests-unit/calc/legacy/calc.css +32 -0
  44. package/tests-unit/color-functions/basic.css +1 -1
  45. package/tests-unit/color-functions/comprehensive.css +5 -5
  46. package/tests-unit/color-functions/comprehensive.less +1 -0
  47. package/tests-unit/color-functions/formats.css +0 -12
  48. package/tests-unit/color-functions/formats.less +0 -15
  49. package/tests-unit/color-functions/legacy/basic.css +21 -0
  50. package/tests-unit/color-functions/legacy/comprehensive.css +48 -0
  51. package/tests-unit/color-functions/legacy/modern-syntax.css +9 -0
  52. package/tests-unit/color-functions/legacy/operations.css +18 -0
  53. package/tests-unit/color-functions/legacy/rgba.css +20 -0
  54. package/tests-unit/color-functions/modern-syntax.css +4 -4
  55. package/tests-unit/color-functions/modern-syntax.less +1 -0
  56. package/tests-unit/color-functions/operations.less +1 -0
  57. package/tests-unit/color-functions/rgba.css +3 -3
  58. package/tests-unit/color-functions/rgba.less +3 -1
  59. package/tests-unit/comments/comments.css +5 -6
  60. package/tests-unit/comments/comments.less +2 -1
  61. package/tests-unit/comments/comments2.css +4 -6
  62. package/tests-unit/comments/comments2.less +3 -0
  63. package/tests-unit/comments/legacy/comments.css +86 -0
  64. package/tests-unit/comments/legacy/comments2.css +21 -0
  65. package/tests-unit/container/container.css +40 -83
  66. package/tests-unit/container/container.less +28 -82
  67. package/tests-unit/container/legacy/container.css +273 -0
  68. package/tests-unit/container/styles.config.ts +8 -0
  69. package/tests-unit/css-3/css-3.css +4 -4
  70. package/tests-unit/css-3/legacy/css-3.css +147 -0
  71. package/tests-unit/css-escapes/css-escapes.css +4 -4
  72. package/tests-unit/css-escapes/legacy/css-escapes.css +34 -0
  73. package/tests-unit/css-escapes/styles.config.ts +5 -0
  74. package/tests-unit/css-grid/css-grid.css +4 -1
  75. package/tests-unit/css-grid/legacy/css-grid.css +27 -0
  76. package/tests-unit/css-guards/css-guards.less +2 -1
  77. package/tests-unit/detached-rulesets/detached-rulesets.css +26 -18
  78. package/tests-unit/detached-rulesets/legacy/detached-rulesets.css +79 -0
  79. package/tests-unit/directives-bubbling/directives-bubbling.css +16 -14
  80. package/tests-unit/extend/extend.css +22 -28
  81. package/tests-unit/extend/legacy/extend.css +79 -0
  82. package/tests-unit/extend/styles.config.ts +5 -0
  83. package/tests-unit/extend-chaining/extend-chaining.css +7 -10
  84. package/tests-unit/extend-chaining/legacy/extend-chaining.css +84 -0
  85. package/tests-unit/extend-clearfix/extend-clearfix.css +1 -3
  86. package/tests-unit/extend-clearfix/extend-clearfix.less +0 -1
  87. package/tests-unit/{extend → extend-clearfix/legacy}/extend-clearfix.css +3 -0
  88. package/tests-unit/extend-exact/extend-exact.css +25 -24
  89. package/tests-unit/extend-exact/legacy/extend-exact.css +40 -0
  90. package/tests-unit/extend-exact/styles.config.ts +5 -0
  91. package/tests-unit/extend-media/extend-media.css +9 -14
  92. package/tests-unit/extend-media/legacy/extend-media.css +27 -0
  93. package/tests-unit/extend-media/styles.config.ts +5 -0
  94. package/tests-unit/extend-nest/extend-nest.css +3 -22
  95. package/tests-unit/extend-nest/legacy/extend-nest.css +60 -0
  96. package/tests-unit/extend-selector/extend-selector.css +42 -67
  97. package/tests-unit/extend-selector/extend-selector.less +0 -15
  98. package/tests-unit/extend-selector/legacy/extend-selector.css +73 -0
  99. package/tests-unit/extend-selector/styles.config.ts +5 -0
  100. package/tests-unit/extract-and-length/extract-and-length.css +6 -5
  101. package/tests-unit/extract-and-length/extract-and-length.less +7 -2
  102. package/tests-unit/extract-and-length/legacy/extract-and-length.css +137 -0
  103. package/tests-unit/functions/functions.css +5 -16
  104. package/tests-unit/functions/functions.less +7 -20
  105. package/tests-unit/functions/legacy/functions.css +244 -0
  106. package/tests-unit/functions/legacy/functions.less +296 -0
  107. package/tests-unit/functions-each/functions-each.css +4 -2
  108. package/tests-unit/import/import-reference-issues.css +6 -6
  109. package/tests-unit/import/import-reference.css +4 -2
  110. package/tests-unit/import/legacy/import-reference-issues.css +27 -0
  111. package/tests-unit/import/legacy/import-reference.css +101 -0
  112. package/tests-unit/import/styles.config.cjs +5 -4
  113. package/tests-unit/layer/layer.css +30 -28
  114. package/tests-unit/layer/legacy/layer.css +136 -0
  115. package/tests-unit/layer/styles.config.ts +5 -0
  116. package/tests-unit/math-css-vars/math-css-vars.css +1 -0
  117. package/tests-unit/math-css-vars/math-css-vars.less +1 -0
  118. package/tests-unit/media/legacy/media.css +274 -0
  119. package/tests-unit/media/media.css +49 -43
  120. package/tests-unit/media/media.less +0 -2
  121. package/tests-unit/media/styles.config.cjs +5 -0
  122. package/tests-unit/merge/merge.css +2 -2
  123. package/tests-unit/mixin-noparens/legacy/mixin-noparens.css +10 -0
  124. package/tests-unit/mixin-noparens/mixin-noparens.css +4 -2
  125. package/tests-unit/mixin-noparens/styles.config.ts +5 -0
  126. package/tests-unit/mixins/legacy/maps.css +9 -0
  127. package/tests-unit/mixins/legacy/mixins.css +147 -0
  128. package/tests-unit/mixins/maps.css +7 -5
  129. package/tests-unit/mixins/mixins.css +7 -5
  130. package/tests-unit/mixins/styles.config.ts +5 -0
  131. package/tests-unit/mixins-closure/legacy/mixins-closure.css +12 -0
  132. package/tests-unit/mixins-closure/mixins-closure.css +4 -2
  133. package/tests-unit/mixins-closure/styles.config.ts +5 -0
  134. package/tests-unit/mixins-guards/legacy/mixins-guards.css +214 -0
  135. package/tests-unit/mixins-guards/mixins-guards.css +5 -3
  136. package/tests-unit/mixins-guards/mixins-guards.less +0 -1
  137. package/tests-unit/mixins-guards/styles.config.ts +5 -0
  138. package/tests-unit/mixins-guards-default-func/legacy/mixins-guards-default-func.css +132 -0
  139. package/tests-unit/mixins-guards-default-func/mixins-guards-default-func.css +0 -2
  140. package/tests-unit/mixins-important/mixins-important.css +33 -19
  141. package/tests-unit/mixins-interpolated/legacy/mixins-interpolated.css +42 -0
  142. package/tests-unit/mixins-interpolated/mixins-interpolated.css +24 -14
  143. package/tests-unit/mixins-interpolated/styles.config.ts +5 -0
  144. package/tests-unit/mixins-nested/legacy/mixins-nested.css +17 -0
  145. package/tests-unit/mixins-nested/mixins-nested.css +16 -12
  146. package/tests-unit/mixins-nested/styles.config.ts +5 -0
  147. package/tests-unit/nesting/legacy/nesting.css +27 -0
  148. package/tests-unit/nesting/nesting-uncollapsed.css +26 -0
  149. package/tests-unit/nesting/nesting.css +1 -1
  150. package/tests-unit/nesting/styles.config.ts +6 -0
  151. package/tests-unit/operations/operations.css +4 -2
  152. package/tests-unit/parse-interpolation/legacy/parse-interpolation.css +39 -0
  153. package/tests-unit/parse-interpolation/parse-interpolation.css +72 -35
  154. package/tests-unit/parse-interpolation/parse-interpolation.less +73 -25
  155. package/tests-unit/parse-interpolation/styles.config.ts +5 -0
  156. package/tests-unit/parser-property-interp/parser-property-interp.css +1 -1
  157. package/tests-unit/parser-property-interp/parser-property-interp.less +2 -2
  158. package/tests-unit/parser-slashed-combinator/parser-slashed-combinator.css +1 -9
  159. package/tests-unit/parser-slashed-combinator/parser-slashed-combinator.less +11 -11
  160. package/tests-unit/plugin/styles.config.ts +11 -0
  161. package/tests-unit/property-accessors/legacy/property-accessors.css +60 -0
  162. package/tests-unit/property-accessors/property-accessors.css +15 -7
  163. package/tests-unit/property-name-interp/legacy/property-name-interp.css +24 -0
  164. package/tests-unit/property-name-interp/property-name-interp.css +1 -1
  165. package/tests-unit/property-name-interp/property-name-interp.less +4 -2
  166. package/tests-unit/property-targeted/legacy/property-targeted.css +7 -0
  167. package/tests-unit/property-targeted/property-targeted.css +1 -1
  168. package/tests-unit/rulesets/legacy/rulesets.css +31 -0
  169. package/tests-unit/rulesets/rulesets.css +30 -30
  170. package/tests-unit/rulesets/styles.config.ts +5 -0
  171. package/tests-unit/scope/legacy/scope.css +41 -0
  172. package/tests-unit/scope/scope.css +1 -1
  173. package/tests-unit/selectors/selectors.css +13 -41
  174. package/tests-unit/styles.config.cjs +1 -1
  175. package/tests-unit/styles.config.ts +8 -0
  176. package/tests-unit/variables/legacy/variable-advanced.css +58 -0
  177. package/tests-unit/variables/variable-advanced.css +1 -4
  178. package/tests-unit/variables/variable-advanced.less +5 -4
  179. package/tests-unit/variables-in-at-rules/variables-in-at-rules.less +3 -2
  180. package/tests-unit/whitespace/legacy/whitespace.css +45 -0
  181. package/tests-unit/whitespace/whitespace.css +3 -2
  182. package/tests-warnings/parentless-ampersand-nested.less +6 -0
  183. package/tests-warnings/parentless-ampersand-nested.txt +42 -0
  184. package/tests-warnings/parentless-ampersand.less +3 -0
  185. package/tests-warnings/parentless-ampersand.txt +21 -0
  186. package/tests-config/rootpath-escape-interpolation/rootpath-escape-interpolation.css +0 -8
  187. package/tests-config/rootpath-escape-interpolation/rootpath-escape-interpolation.less +0 -24
  188. package/tests-config/rootpath-escape-interpolation/styles.config.cjs +0 -8
  189. package/tests-config/sourcemaps/url-interpolation/styles.config.cjs +0 -9
  190. package/tests-config/sourcemaps/url-interpolation/url-interpolation.css +0 -13
  191. package/tests-config/sourcemaps/url-interpolation/url-interpolation.less +0 -24
  192. package/tests-error/parse/property-interpolation-lookup.less +0 -8
  193. package/tests-error/parse/property-interpolation-lookup.txt +0 -4
  194. package/tests-unit/extend/extend-clearfix.less +0 -19
  195. package/tests-unit/lookup-interpolation/lookup-interpolation.css +0 -60
  196. package/tests-unit/lookup-interpolation/lookup-interpolation.less +0 -127
  197. package/tests-unit/media-nested-type/media-nested-type.css +0 -40
  198. package/tests-unit/media-nested-type/media-nested-type.less +0 -51
  199. /package/tests-unit/{directives-bubbling/directives-bubbling.less → at-rules-bubbling/at-rules-bubbling.less} +0 -0
  200. /package/tests-unit/{ie-filters → ie-filters-REMOVED/legacy}/ie-filters.css +0 -0
  201. /package/tests-unit/{ie-filters → ie-filters-REMOVED/legacy}/ie-filters.less +0 -0
  202. /package/tests-unit/{javascript → javascript-REMOVED/legacy}/javascript.css +0 -0
  203. /package/tests-unit/{javascript → javascript-REMOVED/legacy}/javascript.less +0 -0
  204. /package/tests-unit/{javascript → javascript-REMOVED/legacy}/styles.config.cjs +0 -0
@@ -0,0 +1,58 @@
1
+ /* Less 4.x output, recorded when this fixture graduated to v5.
2
+ Historical record only — no test reads this file. */
3
+
4
+ .units-extended {
5
+ width: 1px;
6
+ same-unit-as-previously: 1px;
7
+ square-pixel-divided: 1px;
8
+ odd-unit: 2;
9
+ percentage: 500%;
10
+ pixels: 500px;
11
+ conversion-metric-a: 30mm;
12
+ conversion-metric-b: 3cm;
13
+ conversion-imperial: 3in;
14
+ /* stylelint-disable-next-line unit-no-unknown -- historical Less 4 custom-unit output */
15
+ custom-unit: 420octocats;
16
+ /* stylelint-disable-next-line unit-no-unknown -- historical Less 4 custom-unit output */
17
+ custom-unit-cancelling: 18dogs;
18
+ mix-units: 2px;
19
+ invalid-units: 1px;
20
+ }
21
+ .units-extended .fallback {
22
+ div-px-1: 10px;
23
+ div-px-2: 1px;
24
+ sub-px-1: 12.6px;
25
+ sub-cm-1: 9.666625cm;
26
+ mul-px-1: 19.6px;
27
+ mul-em-1: 19.6em;
28
+ mul-em-2: 196em;
29
+ mul-cm-1: 196cm;
30
+ add-px-1: 15.4px;
31
+ add-px-2: 393.35275591px;
32
+ mul-px-2: 140px;
33
+ mul-px-3: 140px;
34
+ }
35
+ .css-custom-properties {
36
+ --tw-pan-x: ;
37
+ --tw-pan-y: ;
38
+ --tw-pinch-zoom: ;
39
+ --tw-scroll-snap-strictness: proximity;
40
+ }
41
+ .variable-interpolation .radio_checked {
42
+ border-color: #fff;
43
+ }
44
+ .each-with-variables div#apple {
45
+ color: blue;
46
+ }
47
+ .each-with-variables div#banana {
48
+ color: blue;
49
+ }
50
+ .each-with-variables div#cherry {
51
+ color: blue;
52
+ }
53
+ .each-with-variables div#carrot {
54
+ color: blue;
55
+ }
56
+ .each-with-variables div#potato {
57
+ color: blue;
58
+ }
@@ -1,6 +1,3 @@
1
- .alpha {
2
- filter: alpha(opacity=42);
3
- }
4
1
  .units-extended {
5
2
  width: 1px;
6
3
  same-unit-as-previously: 1px;
@@ -26,7 +23,7 @@
26
23
  mul-em-2: 196em;
27
24
  mul-cm-1: 196cm;
28
25
  add-px-1: 15.4px;
29
- add-px-2: 393.35275591px;
26
+ add-px-2: 393.3527559px;
30
27
  mul-px-2: 140px;
31
28
  mul-px-3: 140px;
32
29
  }
@@ -3,10 +3,11 @@
3
3
  @c: #888;
4
4
  @onePixel: 1px;
5
5
 
6
- .alpha {
7
- @var: 42;
8
- filter: alpha(opacity=@var);
9
- }
6
+ // Hasn't been supported since IE8, so removed
7
+ // .alpha {
8
+ // @var: 42;
9
+ // filter: alpha(opacity=@var);
10
+ // }
10
11
 
11
12
  .units-extended {
12
13
  width: @onePixel;
@@ -1,5 +1,6 @@
1
- @Eight: 8;
2
- @charset "UTF-@{Eight}";
1
+ // Less 5 keeps @charset as a static CSS directive. Dynamic charset
2
+ // interpolation is covered by the alpha diagnostic contract instead.
3
+ @charset "UTF-8";
3
4
 
4
5
  @ns: less;
5
6
  @namespace @{ns} "http://lesscss.org";
@@ -0,0 +1,45 @@
1
+ /* Less 4.x output, recorded when this fixture graduated to v5.
2
+ Historical record only — no test reads this file. */
3
+
4
+ .whitespace {
5
+ color: white;
6
+ }
7
+ .whitespace {
8
+ color: white;
9
+ }
10
+ .whitespace {
11
+ color: white;
12
+ }
13
+ .whitespace {
14
+ color: white;
15
+ }
16
+ .whitespace {
17
+ color: white ;
18
+ }
19
+ .white,
20
+ .space,
21
+ .mania {
22
+ color: white;
23
+ }
24
+ .no-semi-column {
25
+ color: white;
26
+ }
27
+ .no-semi-column {
28
+ color: white;
29
+ white-space: pre;
30
+ }
31
+ .no-semi-column {
32
+ border: 2px solid white;
33
+ }
34
+ .newlines {
35
+ background: the,
36
+ great,
37
+ wall;
38
+ border: 2px
39
+ solid
40
+ black;
41
+ }
42
+ .sel .newline_ws .tab_ws {
43
+ color: white;
44
+ background-position: 45 -23;
45
+ }
@@ -11,7 +11,7 @@
11
11
  color: white;
12
12
  }
13
13
  .whitespace {
14
- color: white ;
14
+ color: white;
15
15
  }
16
16
  .white,
17
17
  .space,
@@ -38,5 +38,6 @@
38
38
  }
39
39
  .sel .newline_ws .tab_ws {
40
40
  color: white;
41
- background-position: 45 -23;
41
+ background-position: 45
42
+ -23;
42
43
  }
@@ -0,0 +1,6 @@
1
+ .a {
2
+ color: red;
3
+ }
4
+ & + & {
5
+ color: blue;
6
+ }
@@ -0,0 +1,42 @@
1
+ [
2
+ {
3
+ "code": "selector/parentless-ampersand",
4
+ "phase": "eval",
5
+ "message": "Parentless ampersand ignored",
6
+ "reason": "Selector \"&+&\" uses \"&\" without an available parent selector in this context.",
7
+ "fix": "Move the selector under a real parent selector, or remove the stray \"&\".",
8
+ "file": {
9
+ "name": "parentless-ampersand-nested.less",
10
+ "path": "{path}",
11
+ "fullPath": "{path}parentless-ampersand-nested.less"
12
+ },
13
+ "filePath": "{path}parentless-ampersand-nested.less",
14
+ "line": 4,
15
+ "column": 1,
16
+ "lines": {
17
+ "3": "}",
18
+ "4": "& + & {",
19
+ "5": " color: blue;"
20
+ }
21
+ },
22
+ {
23
+ "code": "selector/parentless-ampersand",
24
+ "phase": "eval",
25
+ "message": "Parentless ampersand ignored",
26
+ "reason": "Selector \"&+&\" uses \"&\" without an available parent selector in this context.",
27
+ "fix": "Move the selector under a real parent selector, or remove the stray \"&\".",
28
+ "file": {
29
+ "name": "parentless-ampersand-nested.less",
30
+ "path": "{path}",
31
+ "fullPath": "{path}parentless-ampersand-nested.less"
32
+ },
33
+ "filePath": "{path}parentless-ampersand-nested.less",
34
+ "line": 4,
35
+ "column": 5,
36
+ "lines": {
37
+ "3": "}",
38
+ "4": "& + & {",
39
+ "5": " color: blue;"
40
+ }
41
+ }
42
+ ]
@@ -0,0 +1,3 @@
1
+ & {
2
+ color: red;
3
+ }
@@ -0,0 +1,21 @@
1
+ [
2
+ {
3
+ "code": "selector/parentless-ampersand",
4
+ "phase": "eval",
5
+ "message": "Parentless ampersand ignored",
6
+ "reason": "Selector \"&\" uses \"&\" without an available parent selector in this context.",
7
+ "fix": "Move the selector under a real parent selector, or remove the stray \"&\".",
8
+ "file": {
9
+ "name": "parentless-ampersand.less",
10
+ "path": "{path}",
11
+ "fullPath": "{path}parentless-ampersand.less"
12
+ },
13
+ "filePath": "{path}parentless-ampersand.less",
14
+ "line": 1,
15
+ "column": 1,
16
+ "lines": {
17
+ "1": "& {",
18
+ "2": " color: red;"
19
+ }
20
+ }
21
+ ]
@@ -1,8 +0,0 @@
1
- #rootpath-escape-interpolation {
2
- plain-unquoted: url(http://example.com/a\(b\)\ c/relative/path);
3
- interp-unquoted: url(http://example.com/a\(b\)\ c/images/path);
4
- lookup-unquoted: url(http://example.com/a\(b\)\ c/images/path);
5
- plain-quoted: url("http://example.com/a(b) c/relative/path");
6
- interp-quoted: url("http://example.com/a(b) c/images/path");
7
- lookup-quoted: url("http://example.com/a(b) c/images/path");
8
- }
@@ -1,24 +0,0 @@
1
- // A rewritten rootpath is escaped only for *unquoted* url() values, so the node
2
- // produced for an interpolated unquoted body must not read as quoted. Giving it a
3
- // real quote character suppressed the escaping and emitted the parentheses and
4
- // space raw, producing a malformed url().
5
- //
6
- // The rootpath here deliberately contains `(`, `)` and a space — the characters
7
- // `escapePath` handles — so quoted and unquoted forms cannot look alike.
8
-
9
- @dir: images;
10
- @paths: {
11
- dir: images;
12
- };
13
-
14
- #rootpath-escape-interpolation {
15
- // unquoted: rootpath must be escaped
16
- plain-unquoted: url(relative/path);
17
- interp-unquoted: url(@{dir}/path);
18
- lookup-unquoted: url(@{paths[dir]}/path);
19
-
20
- // quoted: rootpath must not be escaped
21
- plain-quoted: url("relative/path");
22
- interp-quoted: url("@{dir}/path");
23
- lookup-quoted: url("@{paths[dir]}/path");
24
- }
@@ -1,8 +0,0 @@
1
- module.exports = {
2
- language: {
3
- less: {
4
- "rootpath": "http://example.com/a(b) c/",
5
- "rewriteUrls": "all"
6
- }
7
- }
8
- };
@@ -1,9 +0,0 @@
1
- module.exports = {
2
- language: {
3
- less: {
4
- math: 'strict',
5
- strictUnits: true,
6
- sourceMap: true
7
- }
8
- }
9
- };
@@ -1,13 +0,0 @@
1
- .literal {
2
- background: url(literal/one.png);
3
- }
4
- .interpolated {
5
- background: url(images/two.png);
6
- }
7
- .interpolated-lookup {
8
- background: url(assets/three.png);
9
- }
10
- .quoted-interpolated {
11
- background: url("images/four.png");
12
- }
13
- /*# sourceMappingURL=url-interpolation.css.map */
@@ -1,24 +0,0 @@
1
- // Interpolated unquoted url() bodies are parsed into an escaped Quoted rather
2
- // than the Anonymous node used for literal ones, so this pins that the swap does
3
- // not change how url() values are mapped. All three spellings should keep the
4
- // same mapping structure as each other.
5
- @dir: images;
6
- @paths: {
7
- dir: assets;
8
- };
9
-
10
- .literal {
11
- background: url(literal/one.png);
12
- }
13
-
14
- .interpolated {
15
- background: url(@{dir}/two.png);
16
- }
17
-
18
- .interpolated-lookup {
19
- background: url(@{paths[dir]}/three.png);
20
- }
21
-
22
- .quoted-interpolated {
23
- background: url("@{dir}/four.png");
24
- }
@@ -1,8 +0,0 @@
1
- // Properties have no lookup grammar: `entities.property` parses `$name` with no
2
- // chaining, and nothing can hold a ruleset to look into. `${name[key]}` must
3
- // therefore be rejected rather than reaching the property resolver, where it
4
- // produced a misleading undefined-property error for undefined syntax.
5
- .a {
6
- color: red;
7
- ${color[k]}: value;
8
- }
@@ -1,4 +0,0 @@
1
- ParseError: Unrecognised input in {path}property-interpolation-lookup.less on line 7, column 3:
2
- 6 color: red;
3
- 7 ${color[k]}: value;
4
- 8 }
@@ -1,19 +0,0 @@
1
- .clearfix {
2
- *zoom: 1;
3
- &:after {
4
- content: '';
5
- display: block;
6
- clear: both;
7
- height: 0;
8
- }
9
- }
10
-
11
- .foo {
12
- &:extend(.clearfix all);
13
- color: red;
14
- }
15
-
16
- .bar {
17
- &:extend(.clearfix all);
18
- color: blue;
19
- }
@@ -1,60 +0,0 @@
1
- .quoted {
2
- single: "card";
3
- chained: "inner";
4
- quoted-value: "deep";
5
- indirect-key: "indirect-hit";
6
- empty-key: "tail";
7
- chained-empty-key: "nested-tail";
8
- surrounded: "a-card-b";
9
- twice: "card/blue";
10
- }
11
- .url {
12
- quoted: url("/assets/img/hero.png");
13
- unquoted: url(/assets/img/plain.png);
14
- unquoted-plain: url(/plain/no-lookup.png);
15
- untouched: url(/static/literal.png);
16
- untouched-quoted: url("/static/literal.png");
17
- data-uri: url(data:image/svg+xml;base64,AAAA);
18
- }
19
- .property-interpolation {
20
- color: red;
21
- from-property: "red";
22
- surrounded: "a-red-b";
23
- bare: red;
24
- }
25
- .card {
26
- a: b;
27
- }
28
- .inner {
29
- c: d;
30
- }
31
- .property {
32
- card: from-lookup;
33
- inner: from-chained-lookup;
34
- }
35
- @keyframes card {
36
- from {
37
- opacity: 0;
38
- }
39
- to {
40
- opacity: 1;
41
- }
42
- }
43
- @media (min-width: 768px) {
44
- .responsive {
45
- e: f;
46
- }
47
- }
48
- .custom-property {
49
- --from-lookup: /assets/img;
50
- --from-chained: inner;
51
- }
52
- .recursive {
53
- g: "card";
54
- }
55
- .plain {
56
- h: "name";
57
- }
58
- .name {
59
- i: j;
60
- }
@@ -1,127 +0,0 @@
1
- // `[...]` lookups inside `@{...}` interpolation, backported from Less 5.x.
2
- //
3
- // Before the backport the parser accepted only `@{name}`, so every form below
4
- // either failed to parse or — in string and url positions — silently emitted the
5
- // interpolation verbatim into the output. The url/quoted cases in particular are
6
- // regression coverage for that silent pass-through: a wrong-output bug that
7
- // produced no error and no warning.
8
- //
9
- // The bare `@map[key]` spelling is covered by at-rule-variable-deprecated.less,
10
- // where it is deprecated in structural positions.
11
-
12
- @sizes: {
13
- tablet: 768px;
14
- name: card;
15
- @name: indirect-hit;
16
- last-entry: tail;
17
- };
18
-
19
- @theme: {
20
- color: blue;
21
- @nested: {
22
- name: inner;
23
- label: "deep";
24
- last-entry: nested-tail;
25
- }
26
- };
27
-
28
- @paths: {
29
- img: "/assets/img";
30
- };
31
-
32
- @which: name;
33
-
34
- // --- quoted strings ---
35
- .quoted {
36
- single: "@{sizes[name]}";
37
- chained: "@{theme[@nested][name]}";
38
- quoted-value: "@{theme[@nested][label]}";
39
- indirect-key: "@{sizes[@@which]}";
40
- empty-key: "@{sizes[]}";
41
- chained-empty-key: "@{theme[@nested][]}";
42
- surrounded: "a-@{sizes[name]}-b";
43
- twice: "@{sizes[name]}/@{theme[color]}";
44
- }
45
-
46
- // --- url() — the silent pass-through regression ---
47
- // An unquoted url() body was raw text in an Anonymous node, so neither the plain
48
- // nor the lookup interpolation resolved there while the quoted form did. Both
49
- // spellings are covered so the two cannot diverge again.
50
- @plain-path: "/plain";
51
-
52
- .url {
53
- quoted: url("@{paths[img]}/hero.png");
54
- unquoted: url(@{paths[img]}/plain.png);
55
- unquoted-plain: url(@{plain-path}/no-lookup.png);
56
- untouched: url(/static/literal.png);
57
- untouched-quoted: url("/static/literal.png");
58
- data-uri: url(data:image/svg+xml;base64,AAAA);
59
- }
60
-
61
- // --- ${...} property interpolation ---
62
- // Properties have no lookup grammar: `$name[key]` is a property reference followed
63
- // by literal `[key]`, and `prop: { … }` is a parse error in every scope, so nothing
64
- // can hold a ruleset to look into. `${...}` therefore stays narrow while `@{...}`
65
- // carries lookups, and the plain form must keep working unchanged.
66
- .property-interpolation {
67
- color: red;
68
- from-property: "${color}";
69
- surrounded: "a-${color}-b";
70
- bare: $color;
71
- }
72
-
73
- // --- selector interpolation ---
74
- .@{sizes[name]} {
75
- a: b;
76
- }
77
-
78
- .@{theme[@nested][name]} {
79
- c: d;
80
- }
81
-
82
- // --- property name interpolation ---
83
- .property {
84
- @{sizes[name]}: from-lookup;
85
- @{theme[@nested][name]}: from-chained-lookup;
86
- }
87
-
88
- // --- at-rule name and prelude ---
89
- @keyframes @{sizes[name]} {
90
- from { opacity: 0; }
91
- to { opacity: 1; }
92
- }
93
-
94
- @queries: {
95
- tablet: ~"(min-width: 768px)";
96
- };
97
-
98
- @media @{queries[tablet]} {
99
- .responsive {
100
- e: f;
101
- }
102
- }
103
-
104
- // --- custom property values ---
105
- .custom-property {
106
- --from-lookup: @{paths[img]};
107
- --from-chained: @{theme[@nested][name]};
108
- }
109
-
110
- // --- interpolation still resolves to a fixpoint ---
111
- // The inner `@{...}` arrives from a variable's value at eval time, so it is not
112
- // present in the source text of the outer reference.
113
- @inner: card;
114
- @outer: ~"@{inner}";
115
-
116
- .recursive {
117
- g: "@{outer}";
118
- }
119
-
120
- // --- plain interpolation is unaffected by the lookup support ---
121
- .plain {
122
- h: "@{which}";
123
- }
124
-
125
- .@{which} {
126
- i: j;
127
- }
@@ -1,40 +0,0 @@
1
- @media screen and (max-width: 500px) {
2
- .a {
3
- color: red;
4
- }
5
- }
6
- @media only screen and (min-width: 100px) {
7
- .b {
8
- color: blue;
9
- }
10
- }
11
- @media all and (max-width: 9px) {
12
- .c {
13
- color: green;
14
- }
15
- }
16
- @media print and (color) and (min-width: 1px) {
17
- .d {
18
- color: black;
19
- }
20
- }
21
- @media screen and (max-width: 500px) {
22
- .e {
23
- color: red;
24
- }
25
- }
26
- @media (max-width: 500px) and (min-width: 100px) {
27
- .f {
28
- color: red;
29
- }
30
- }
31
- @media tester and (max-width: 500px) {
32
- .g {
33
- color: red;
34
- }
35
- }
36
- @media screen and (max-width: 500px) {
37
- .h {
38
- color: red;
39
- }
40
- }
@@ -1,51 +0,0 @@
1
- // A media type nested inside conditions must lead the flattened query,
2
- // otherwise the result is invalid CSS (issue #3694, #3764).
3
- @media (max-width: 500px) {
4
- @media screen {
5
- .a { color: red; }
6
- }
7
- }
8
- @media (min-width: 100px) {
9
- @media only screen {
10
- .b { color: blue; }
11
- }
12
- }
13
- @media (max-width: 9px) {
14
- @media all {
15
- .c { color: green; }
16
- }
17
- }
18
- @media (min-width: 1px) {
19
- @media print and (color) {
20
- .d { color: black; }
21
- }
22
- }
23
-
24
- // Already-correct ordering is preserved.
25
- @media screen {
26
- @media (max-width: 500px) {
27
- .e { color: red; }
28
- }
29
- }
30
-
31
- // Queries without a media type are left untouched.
32
- @media (max-width: 500px) {
33
- @media (min-width: 100px) {
34
- .f { color: red; }
35
- }
36
- }
37
-
38
- // Unknown media types are valid CSS non-matches, so they reorder too.
39
- @media (max-width: 500px) {
40
- @media tester {
41
- .g { color: red; }
42
- }
43
- }
44
-
45
- // An escaped-string feature condition (Anonymous) must not be mistaken for a media type.
46
- @fc: ~"(max-width: 500px)";
47
- @media @fc {
48
- @media screen {
49
- .h { color: red; }
50
- }
51
- }