less 1.7.0 → 1.7.5

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 (109) hide show
  1. package/.grunt/grunt-contrib-jasmine/es5-shim.js +1360 -0
  2. package/.idea/jsLibraryMappings.xml +0 -1
  3. package/.idea/workspace.xml +182 -183
  4. package/.travis.yml +0 -1
  5. package/CHANGELOG.md +60 -2
  6. package/CONTRIBUTING.md +1 -1
  7. package/Gruntfile.js +12 -24
  8. package/LICENSE +0 -2
  9. package/README.md +5 -3
  10. package/benchmark/less-benchmark.js +1 -2
  11. package/bin/lessc +13 -11
  12. package/bower.json +2 -2
  13. package/build/rhino-modules.js +1 -1
  14. package/dist/less-1.7.0.js +59 -59
  15. package/dist/less-1.7.0.min.js +12 -12
  16. package/dist/less-1.7.1.js +7936 -0
  17. package/dist/less-1.7.1.min.js +16 -0
  18. package/dist/less-1.7.2.js +7938 -0
  19. package/dist/less-1.7.2.min.js +16 -0
  20. package/dist/less-1.7.3.js +7942 -0
  21. package/dist/less-1.7.3.min.js +16 -0
  22. package/dist/less-1.7.4.js +7979 -0
  23. package/dist/less-1.7.4.min.js +16 -0
  24. package/dist/less-1.7.5.js +8008 -0
  25. package/dist/less-1.7.5.min.js +16 -0
  26. package/dist/less-rhino-1.7.0.js +48 -48
  27. package/dist/less-rhino-1.7.1.js +9311 -0
  28. package/dist/less-rhino-1.7.2.js +9313 -0
  29. package/dist/less-rhino-1.7.3.js +9317 -0
  30. package/dist/less-rhino-1.7.4.js +9354 -0
  31. package/dist/less-rhino-1.7.5.js +9383 -0
  32. package/dist/lessc-rhino-1.7.0.js +2 -2
  33. package/dist/lessc-rhino-1.7.1.js +449 -0
  34. package/dist/lessc-rhino-1.7.2.js +449 -0
  35. package/dist/lessc-rhino-1.7.3.js +449 -0
  36. package/dist/lessc-rhino-1.7.4.js +449 -0
  37. package/dist/lessc-rhino-1.7.5.js +449 -0
  38. package/lib/less/browser.js +14 -9
  39. package/lib/less/env.js +2 -0
  40. package/lib/less/fs.js +10 -0
  41. package/lib/less/functions.js +41 -38
  42. package/lib/less/import-visitor.js +9 -7
  43. package/lib/less/index.js +30 -18
  44. package/lib/less/lessc_helper.js +1 -0
  45. package/lib/less/parser/parser.js.orig +1747 -0
  46. package/lib/less/parser.js +81 -40
  47. package/lib/less/rhino.js +3 -3
  48. package/lib/less/source-map-output.js +1 -1
  49. package/lib/less/to-css-visitor.js +3 -0
  50. package/lib/less/tree/anonymous.js +7 -3
  51. package/lib/less/tree/directive.js +6 -0
  52. package/lib/less/tree/element.js +6 -22
  53. package/lib/less/tree/import.js +1 -1
  54. package/lib/less/tree/mixin.js +4 -3
  55. package/lib/less/tree/quoted.js +12 -4
  56. package/lib/less/tree/rule.js +7 -4
  57. package/lib/less/tree/rule.js.orig +164 -0
  58. package/lib/less/tree/ruleset.js +27 -2
  59. package/lib/less/tree/selector.js +1 -1
  60. package/lib/less/tree.js +2 -2
  61. package/package.json +13 -12
  62. package/test/browser/less.js +7317 -6931
  63. package/test/css/comments.css +8 -0
  64. package/test/css/css-3.css +9 -0
  65. package/test/css/functions.css +8 -8
  66. package/test/css/import-inline.css +4 -1
  67. package/test/css/import.css +6 -0
  68. package/test/css/javascript.css +5 -0
  69. package/test/css/mixins-guards.css +14 -3
  70. package/test/css/mixins.css +3 -0
  71. package/test/css/property-name-interp.css +1 -0
  72. package/test/css/urls.css +6 -0
  73. package/test/index.js +1 -1
  74. package/test/less/comments.less +14 -1
  75. package/test/less/css-3.less +12 -1
  76. package/test/less/errors/color-invalid-hex-code.less +3 -0
  77. package/test/less/errors/color-invalid-hex-code.txt +4 -0
  78. package/test/less/errors/color-invalid-hex-code2.less +3 -0
  79. package/test/less/errors/color-invalid-hex-code2.txt +4 -0
  80. package/test/less/errors/import-malformed.less +1 -0
  81. package/test/less/errors/import-malformed.txt +3 -0
  82. package/test/less/errors/import-no-semi.txt +1 -1
  83. package/test/less/errors/javascript-error.less +1 -1
  84. package/test/less/errors/javascript-error.txt +2 -2
  85. package/test/less/import-inline.less +1 -0
  86. package/test/less/import.less +8 -1
  87. package/test/less/javascript.less +9 -0
  88. package/test/less/mixins-guards.less +17 -3
  89. package/test/less/mixins.less +4 -0
  90. package/test/less/property-name-interp.less +4 -1
  91. package/test/less/property-name-interp.less.orig +59 -0
  92. package/test/less/urls.less +12 -0
  93. package/test/less-test.js +7 -8
  94. package/test/modify-vars.js +17 -0
  95. package/test/sourcemaps/basic.json +1 -1
  96. package/tmp/browser/test-runner-main.html +4 -0
  97. package/tmp/less.js +8295 -0
  98. package/build/README.md +0 -51
  99. package/tmp/browser/test-postProcessor.html +0 -59
  100. package/tmp/browser/test-runner-browser.html +0 -59
  101. package/tmp/browser/test-runner-errors.html +0 -267
  102. package/tmp/browser/test-runner-global-vars.html +0 -59
  103. package/tmp/browser/test-runner-legacy.html +0 -59
  104. package/tmp/browser/test-runner-modify-vars.html +0 -59
  105. package/tmp/browser/test-runner-no-js-errors.html +0 -59
  106. package/tmp/browser/test-runner-production.html +0 -55
  107. package/tmp/browser/test-runner-relative-urls.html +0 -59
  108. package/tmp/browser/test-runner-rootpath-relative.html +0 -59
  109. package/tmp/browser/test-runner-rootpath.html +0 -59
@@ -55,6 +55,14 @@
55
55
  .test {
56
56
  color: 1px;
57
57
  }
58
+ .sr-only-focusable {
59
+ clip: auto;
60
+ }
61
+ @-webkit-keyframes hover {
62
+ 0% {
63
+ color: red;
64
+ }
65
+ }
58
66
  #last {
59
67
  color: #0000ff;
60
68
  }
@@ -127,3 +127,12 @@ h1 {
127
127
  body ^^ .shadow {
128
128
  display: done;
129
129
  }
130
+ :host(.sel .a),
131
+ :host-context(.sel .b),
132
+ .sel /deep/ .b,
133
+ ::content .sel {
134
+ type: shadow-dom;
135
+ }
136
+ #issue2066 {
137
+ background: url('/images/icon-team.svg') 0 0 / contain;
138
+ }
@@ -19,17 +19,17 @@
19
19
  luma-white: 100%;
20
20
  luma-black: 0%;
21
21
  luma-black-alpha: 0%;
22
- luma-red: 21%;
23
- luma-green: 72%;
24
- luma-blue: 7%;
25
- luma-yellow: 93%;
26
- luma-cyan: 79%;
27
- luma-differs-from-luminance: 24%;
22
+ luma-red: 21.26%;
23
+ luma-green: 71.52%;
24
+ luma-blue: 7.22%;
25
+ luma-yellow: 92.78%;
26
+ luma-cyan: 78.74%;
27
+ luma-differs-from-luminance: 23.89833349%;
28
28
  luminance-white: 100%;
29
29
  luminance-black: 0%;
30
30
  luminance-black-alpha: 0%;
31
- luminance-red: 21%;
32
- luminance-differs-from-luma: 36%;
31
+ luminance-red: 21.26%;
32
+ luminance-differs-from-luma: 36.40541176%;
33
33
  contrast-filter: contrast(30%);
34
34
  saturate-filter: saturate(5%);
35
35
  contrast-white: #000000;
@@ -1,5 +1,8 @@
1
- this isn't very valid CSS.
1
+ #import {
2
+ color: #ff0000;
3
+ }
2
4
  @media (min-width: 600px) {
3
5
  #css { color: yellow; }
4
6
 
5
7
  }
8
+ this isn't very valid CSS.
@@ -1,3 +1,4 @@
1
+ @charset "UTF-8";
1
2
  @import url(http://fonts.googleapis.com/css?family=Open+Sans);
2
3
  @import url(/absolute/something.css) screen and (color) and (max-width: 600px);
3
4
  @import url("//ha.com/file.css") (min-width: 100px);
@@ -34,3 +35,8 @@
34
35
  color: yellow;
35
36
  }
36
37
  }
38
+ @media print {
39
+ body {
40
+ width: 100%;
41
+ }
42
+ }
@@ -21,3 +21,8 @@
21
21
  ary: "1, 2, 3";
22
22
  ary1: "1, 2, 3";
23
23
  }
24
+ .test-tran {
25
+ 1: opacity 0.3s ease-in 0.3s, max-height 0.6s linear, margin-bottom 0.4s linear;
26
+ 2: [opacity 0.3s ease-in 0.3s, max-height 0.6s linear, margin-bottom 0.4s linear];
27
+ 3: opacity 0.3s ease-in 0.3s, max-height 0.6s linear, margin-bottom 0.4s linear;
28
+ }
@@ -67,9 +67,17 @@
67
67
  content: is not #0000ff its #800080;
68
68
  }
69
69
  .stringguardtest {
70
- content: is theme1;
71
- content: is not theme2;
72
- content: is theme1 no quotes;
70
+ content: "theme1" is "theme1";
71
+ content: "theme1" is not "theme2";
72
+ content: "theme1" is 'theme1';
73
+ content: "theme1" is not 'theme2';
74
+ content: 'theme1' is "theme1";
75
+ content: 'theme1' is not "theme2";
76
+ content: 'theme1' is 'theme1';
77
+ content: 'theme1' is not 'theme2';
78
+ content: theme1 is not "theme2";
79
+ content: theme1 is not 'theme2';
80
+ content: theme1 is theme1;
73
81
  }
74
82
  #tryNumberPx {
75
83
  catch: all;
@@ -80,3 +88,6 @@
80
88
  a: 1;
81
89
  x: 1;
82
90
  }
91
+ .mixin-generated-class {
92
+ a: 1;
93
+ }
@@ -7,6 +7,9 @@
7
7
  .borders {
8
8
  border-style: dashed;
9
9
  }
10
+ .mixin > * {
11
+ border: do not match me;
12
+ }
10
13
  #namespace .borders {
11
14
  border-style: dotted;
12
15
  }
@@ -1,5 +1,6 @@
1
1
  pi-test {
2
2
  border: 0;
3
+ @not-variable: @not-variable;
3
4
  ufo-width: 50%;
4
5
  *-z-border: 1px dashed blue;
5
6
  -www-border-top: 2px;
package/test/css/urls.css CHANGED
@@ -53,6 +53,7 @@
53
53
  }
54
54
  #data-uri {
55
55
  uri: url("data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg==");
56
+ uri-fragment: url("data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg==#fragment");
56
57
  }
57
58
  #data-uri-guess {
58
59
  uri: url("data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg==");
@@ -69,3 +70,8 @@
69
70
  background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjxsaW5lYXJHcmFkaWVudCBpZD0iZ3JhZGllbnQiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIvPjxzdG9wIG9mZnNldD0iMyUiIHN0b3AtY29sb3I9IiNmZmE1MDAiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZmZmZmYiLz48L2xpbmVhckdyYWRpZW50PjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9InVybCgjZ3JhZGllbnQpIiAvPjwvc3ZnPg==');
70
71
  background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjxsaW5lYXJHcmFkaWVudCBpZD0iZ3JhZGllbnQiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIxJSIgc3RvcC1jb2xvcj0iI2M0YzRjNCIvPjxzdG9wIG9mZnNldD0iMyUiIHN0b3AtY29sb3I9IiNmZmE1MDAiLz48c3RvcCBvZmZzZXQ9IjUlIiBzdG9wLWNvbG9yPSIjMDA4MDAwIi8+PHN0b3Agb2Zmc2V0PSI5NSUiIHN0b3AtY29sb3I9IiNmZmZmZmYiLz48L2xpbmVhckdyYWRpZW50PjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9InVybCgjZ3JhZGllbnQpIiAvPjwvc3ZnPg==');
71
72
  }
73
+ @font-face {
74
+ font-family: 'MyWebFont';
75
+ src: url(webfont.eot);
76
+ src: url('webfont.eot?#iefix') format('embedded-opentype'), url('webfont.woff') format('woff'), format('truetype') url('webfont.ttf'), url('webfont.svg#svgFontName') format('svg');
77
+ }
package/test/index.js CHANGED
@@ -14,7 +14,7 @@ function getErrorPathReplacementFunction(dir) {
14
14
  };
15
15
  }
16
16
 
17
- console.log("\n" + stylize("LESS", 'underline') + "\n");
17
+ console.log("\n" + stylize("Less", 'underline') + "\n");
18
18
  lessTester.runTestSet({strictMath: true, relativeUrls: true, silent: true});
19
19
  lessTester.runTestSet({strictMath: true, strictUnits: true}, "errors/",
20
20
  lessTester.testErrors, null, getErrorPathReplacementFunction("errors"));
@@ -62,7 +62,7 @@
62
62
  */
63
63
 
64
64
  .selector /* .with */, .lots, /* of */ .comments {
65
- color: grey, /* blue */ orange;
65
+ color/* survive */ /* me too */: grey, /* blue */ orange;
66
66
  -webkit-border-radius: 2px /* webkit only */;
67
67
  -moz-border-radius: (2px * 4) /* moz only with operation */;
68
68
  }
@@ -77,6 +77,19 @@
77
77
  }
78
78
  .mixin_def_with_colors();
79
79
 
80
+ // .s when
81
+ //R/2
82
+
83
+ .sr-only-focusable {
84
+ clip: auto;
85
+ }
86
+
87
+ @-webkit-keyframes /* Safari */ hover /* and Chrome */ {
88
+ 0% {
89
+ color: red;
90
+ }
91
+ }
92
+
80
93
  #last { color: blue }
81
94
  //
82
95
 
@@ -126,4 +126,15 @@ h1 { color: green; }
126
126
  .shadow ^ .dom,
127
127
  body ^^ .shadow {
128
128
  display: done;
129
- }
129
+ }
130
+
131
+ :host(.sel .a),
132
+ :host-context(.sel .b),
133
+ .sel /deep/ .b,
134
+ ::content .sel {
135
+ type: shadow-dom;
136
+ }
137
+
138
+ #issue2066 {
139
+ background: url('/images/icon-team.svg') 0 0 / contain;
140
+ }
@@ -0,0 +1,3 @@
1
+ .a {
2
+ @wrongHEXColorCode: #DCALLB;
3
+ }
@@ -0,0 +1,4 @@
1
+ SyntaxError: Invalid HEX color code in {path}color-invalid-hex-code.less on line 2, column 29:
2
+ 1 .a {
3
+ 2 @wrongHEXColorCode: #DCALLB;
4
+ 3 }
@@ -0,0 +1,3 @@
1
+ .a {
2
+ @wrongHEXColorCode: #fffblack;
3
+ }
@@ -0,0 +1,4 @@
1
+ SyntaxError: Invalid HEX color code in {path}color-invalid-hex-code2.less on line 2, column 29:
2
+ 1 .a {
3
+ 2 @wrongHEXColorCode: #fffblack;
4
+ 3 }
@@ -0,0 +1 @@
1
+ @import malformed "this-statement-is-invalid.less";
@@ -0,0 +1,3 @@
1
+ SyntaxError: malformed import statement in {path}import-malformed.less on line 1, column 1:
2
+ 1 @import malformed "this-statement-is-invalid.less";
3
+ 2
@@ -1,2 +1,2 @@
1
- ParseError: Unrecognised input in {path}import-no-semi.less on line 1, column 1:
1
+ SyntaxError: missing semi-colon or unrecognised media features on import in {path}import-no-semi.less on line 1, column 1:
2
2
  1 @import "this-statement-is-invalid.less"
@@ -1,3 +1,3 @@
1
1
  .scope {
2
- var: `this.foo.toJS()`;
2
+ var: `this.foo.toJS`;
3
3
  }
@@ -1,4 +1,4 @@
1
- SyntaxError: JavaScript evaluation error: 'TypeError: Cannot call method 'toJS' of undefined' in {path}javascript-error.less on line 2, column 27:
1
+ SyntaxError: JavaScript evaluation error: 'TypeError: Cannot read property 'toJS' of undefined' in {path}javascript-error.less on line 2, column 25:
2
2
  1 .scope {
3
- 2 var: `this.foo.toJS()`;
3
+ 2 var: `this.foo.toJS`;
4
4
  3 }
@@ -1,2 +1,3 @@
1
+ @import url("import/import-test-c.less");// import inline should not float above this #1954
1
2
  @import (inline) url("import/import-test-d.css") (min-width:600px);
2
3
  @import (inline, css) url("import/invalid-css.less");
@@ -18,4 +18,11 @@
18
18
 
19
19
  @import (multiple) "import/import-test-e" screen and (max-width: 602px);
20
20
 
21
- @import (less, multiple) url("import/import-test-d.css") screen and (max-width: 603px);
21
+ @import (less, multiple) url("import/import-test-d.css") screen and (max-width: 603px);
22
+
23
+ @media print {
24
+ @import (multiple) "import/import-test-e";
25
+ }
26
+
27
+ @charset "UTF-8"; // climb on top #2126
28
+
@@ -27,3 +27,12 @@
27
27
  ary: `@{ary}.join(', ')`;
28
28
  ary1: `@{ary2}.join(', ')`;
29
29
  }
30
+ .transitions(...) {
31
+ @arg: ~`"@{arguments}".replace(/[\[\]]*/g, '')`;
32
+ 1: @arg; // rounded to integers
33
+ 2: ~`"@{arguments}"`; // rounded to integers
34
+ 3: @arguments; // OK
35
+ }
36
+ .test-tran {
37
+ .transitions(opacity 0.3s ease-in 0.3s, max-height 0.6s linear, margin-bottom 0.4s linear;);
38
+ }
@@ -116,13 +116,17 @@
116
116
  .colorguard(purple);
117
117
  }
118
118
 
119
- .stringguard(@str) when (@str = "theme1") { content: is theme1; }
120
- .stringguard(@str) when not ("theme2" = @str) { content: is not theme2; }
121
- .stringguard(@str) when (~"theme1" = @str) { content: is theme1 no quotes; }
119
+ .stringguard(@str) when (@str = "theme1") { content: @str is "theme1"; }
120
+ .stringguard(@str) when not ("theme2" = @str) { content: @str is not "theme2"; }
121
+ .stringguard(@str) when (@str = 'theme1') { content: @str is 'theme1'; }
122
+ .stringguard(@str) when not ('theme2' = @str) { content: @str is not 'theme2'; }
123
+ .stringguard(@str) when (~"theme1" = @str) { content: @str is theme1; }
122
124
  .stringguard(@str) {}
123
125
  .stringguardtest {
124
126
  .stringguard("theme1");
125
127
  .stringguard("theme2");
128
+ .stringguard('theme1');
129
+ .stringguard('theme2');
126
130
  .stringguard(theme1);
127
131
  }
128
132
 
@@ -157,3 +161,13 @@
157
161
  }
158
162
  }
159
163
  .bug-100cm-1m(100cm);
164
+
165
+ #ns {
166
+ .mixin-for-root-usage(@a) when (@a > 0) {
167
+ .mixin-generated-class {
168
+ a: @a;
169
+ }
170
+ }
171
+ }
172
+
173
+ #ns > .mixin-for-root-usage(1);
@@ -1,6 +1,7 @@
1
1
  .mixin { border: 1px solid black; }
2
2
  .mixout { border-color: orange; }
3
3
  .borders { border-style: dashed; }
4
+ .mixin > * { border: do not match me; }
4
5
 
5
6
  #namespace {
6
7
  .borders {
@@ -136,6 +137,9 @@ h3 { .margin_between(15px, 5px); }
136
137
  .clearfix {
137
138
  .clearfix();
138
139
  }
140
+ .clearfix {
141
+ .clearfix();
142
+ }
139
143
  .foo {
140
144
  .clearfix();
141
145
  }
@@ -6,8 +6,11 @@ pi-test {
6
6
  @c_c: left;
7
7
  @d-d4: radius;
8
8
  @-: -;
9
-
9
+
10
+ @var: ~'@not-variable';
11
+
10
12
  @{a}: 0;
13
+ @{var}: @var;
11
14
  @{prefix}width: 50%;
12
15
  *-z-@{a} :1px dashed blue;
13
16
  -www-@{a}-@{bb}: 2px;
@@ -0,0 +1,59 @@
1
+
2
+ pi-test {
3
+ @prefix: ufo-;
4
+ @a: border;
5
+ @bb: top;
6
+ @c_c: left;
7
+ @d-d4: radius;
8
+ @-: -;
9
+
10
+ <<<<<<< HEAD
11
+ =======
12
+ @var: ~'@not-variable';
13
+
14
+ >>>>>>> origin/master
15
+ @{a}: 0;
16
+ @{var}: @var;
17
+ @{prefix}width: 50%;
18
+ *-z-@{a} :1px dashed blue;
19
+ -www-@{a}-@{bb}: 2px;
20
+ @{d-d4}-is-not-a-@{a}:true;
21
+ @{a}-@{bb}-@{c_c}-@{d-d4} : 2em;
22
+ @{a}@{-}@{bb}@{-}red@{-}@{d-d4}-: 3pt;
23
+
24
+ .mixin(mixer);
25
+ .merge(ish, base);
26
+ }
27
+
28
+ @global: global;
29
+
30
+ .mixin(@arg) {
31
+ @local: local;
32
+ @{global}-@{local}-@{arg}-property: strong;
33
+ }
34
+
35
+ .merge(@p, @v) {
36
+ &-merge {
37
+ @prefix: pre;
38
+ @suffix: ish;
39
+ @{prefix}-property-ish+ :high;
40
+ pre-property-@{suffix} +: middle;
41
+ @{prefix}-property-@{suffix}+: low;
42
+ @{prefix}-property-@{p} + : @v;
43
+
44
+ @subterfuge: ~'+';
45
+ pre-property-ish@{subterfuge}: nice try dude;
46
+ }
47
+ }
48
+
49
+ pi-indirect-vars {
50
+ @{p}: @p;
51
+ @p: @@a;
52
+ @a: b;
53
+ @b: auto;
54
+ }
55
+
56
+ pi-complex-values {
57
+ @{p}@{p}: none;
58
+ @p: (1 + 2px) fadeout(#ff0, 50%), pi() /* foo */;
59
+ }
@@ -42,6 +42,7 @@
42
42
 
43
43
  #data-uri {
44
44
  uri: data-uri('image/jpeg;base64', '../data/image.jpg');
45
+ uri-fragment: data-uri('image/jpeg;base64', '../data/image.jpg#fragment');
45
46
  }
46
47
 
47
48
  #data-uri-guess {
@@ -70,3 +71,14 @@
70
71
  @orange_color: orange;
71
72
  background-image: svg-gradient(to bottom, (mix(black, white) + #444) 1%, @orange_color @orange_percentage, ((@green_5)), white 95%);
72
73
  }
74
+ //it should work also inside @font-face #2035
75
+ @font-face {
76
+ font-family: 'MyWebFont';
77
+ src: url(webfont.eot);
78
+ src+: url('webfont.eot?#iefix');
79
+ src+_: format('embedded-opentype');
80
+ src+: url('webfont.woff') format('woff');
81
+ src+: format('truetype');
82
+ src+_: url('webfont.ttf');
83
+ src+: url('webfont.svg#svgFontName') format('svg');
84
+ }
package/test/less-test.js CHANGED
@@ -2,8 +2,7 @@
2
2
 
3
3
  module.exports = function() {
4
4
  var path = require('path'),
5
- fs = require('fs'),
6
- sys = require('util');
5
+ fs = require('fs');
7
6
 
8
7
  var less = require('../lib/less');
9
8
  var stylize = require('../lib/less/lessc_helper').stylize;
@@ -31,7 +30,7 @@ module.exports = function() {
31
30
 
32
31
  function testSourcemap(name, err, compiledLess, doReplacements, sourcemap) {
33
32
  fs.readFile(path.join('test/', name) + '.json', 'utf8', function (e, expectedSourcemap) {
34
- sys.print("- " + name + ": ");
33
+ process.stdout.write("- " + name + ": ");
35
34
  if (sourcemap === expectedSourcemap) {
36
35
  ok('OK');
37
36
  } else if (err) {
@@ -48,7 +47,7 @@ module.exports = function() {
48
47
 
49
48
  function testErrors(name, err, compiledLess, doReplacements) {
50
49
  fs.readFile(path.join('test/less/', name) + '.txt', 'utf8', function (e, expectedErr) {
51
- sys.print("- " + name + ": ");
50
+ process.stdout.write("- " + name + ": ");
52
51
  expectedErr = doReplacements(expectedErr, 'test/less/errors/');
53
52
  if (!err) {
54
53
  if (compiledLess) {
@@ -130,7 +129,7 @@ module.exports = function() {
130
129
  var css_name = name;
131
130
  if(nameModifier) { css_name = nameModifier(name); }
132
131
  fs.readFile(path.join('test/css', css_name) + '.css', 'utf8', function (e, css) {
133
- sys.print("- " + css_name + ": ");
132
+ process.stdout.write("- " + css_name + ": ");
134
133
 
135
134
  css = css && doReplacements(css, 'test/less/' + foldername);
136
135
  if (less === css) { ok('OK'); }
@@ -152,9 +151,9 @@ module.exports = function() {
152
151
  require('diff').diffLines(left, right).forEach(function(item) {
153
152
  if(item.added || item.removed) {
154
153
  var text = item.value.replace("\n", String.fromCharCode(182) + "\n");
155
- sys.print(stylize(text, item.added ? 'green' : 'red'));
154
+ process.stdout.write(stylize(text, item.added ? 'green' : 'red'));
156
155
  } else {
157
- sys.print(item.value);
156
+ process.stdout.write(item.value);
158
157
  }
159
158
  });
160
159
  console.log("");
@@ -241,7 +240,7 @@ module.exports = function() {
241
240
  function testNoOptions() {
242
241
  totalTests++;
243
242
  try {
244
- sys.print("- Integration - creating parser without options: ");
243
+ process.stdout.write("- Integration - creating parser without options: ");
245
244
  new(less.Parser)();
246
245
  } catch(e) {
247
246
  fail(stylize("FAIL\n", "red"));
@@ -0,0 +1,17 @@
1
+ var less = require('../lib/less'),
2
+ fs = require('fs')
3
+
4
+ var input = fs.readFileSync("./test/less/modifyVars/extended.less", 'utf8')
5
+ var expectedCss = fs.readFileSync('./test/css/modifyVars/extended.css', 'utf8')
6
+ var options = {
7
+ modifyVars: JSON.parse(fs.readFileSync("./test/less/modifyVars/extended.json", 'utf8'))
8
+ }
9
+
10
+ less.render(input, options, function (err, css) {
11
+ if (err) console.log(err);
12
+ if (css === expectedCss) {
13
+ console.log("PASS")
14
+ } else {
15
+ console.log("FAIL")
16
+ }
17
+ })
@@ -1 +1 @@
1
- {"version":3,"file":"sourcemaps/basic.css","sources":["testweb/sourcemaps/imported.css","testweb/sourcemaps/basic.less"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;ACAA;EACE,YAAA;EAJA,UAAA;EAWA,iBAAA;EALA,WAAA;EACA,mBAAA;;AAJF,EASE;AATF,EASM;EACF,gBAAA;;AACA,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFA;AAEF,EAFE,GAEA,KAFJ;AAEE,EAFE,GAEA,KAFA;EAGA,UAAA;;AALN;AAAI;AAUJ;EATE,iBAAA;;AADF,EAEE;AAFE,EAEF;AAFF,EAEM;AAFF,EAEE;AAQN,OARE;AAQF,OARM;EACF,gBAAA;;AACA,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFA;AAEF,EAFF,GAEI,KAFA;AAEF,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFA;AAEF,EAFF,GAEI,KAFA;AAEF,EAFE,GAEA,KAFJ;AAEE,EAFE,GAEA,KAFJ;AAEE,EAFE,GAEA,KAFA;AAEF,EAFE,GAEA,KAFA;AAEF,EAFE,GAEA,KAFJ;AAEE,EAFE,GAEA,KAFJ;AAEE,EAFE,GAEA,KAFA;AAEF,EAFE,GAEA,KAFA;AAQN,OARE,GAQF,UARE;AAQF,OARE,GAEI,KAFJ;AAQF,OARE,GAQF,UARM;AAQN,OARE,GAEI,KAFA;AAEF,EAFF,GAQF,UARE;AAEE,EAFF,GAQF,UARM;AAQN,OARM,GAQN,UARE;AAQF,OARM,GAEA,KAFJ;AAQF,OARM,GAQN,UARM;AAQN,OARM,GAEA,KAFA;AAEF,EAFE,GAQN,UARE;AAEE,EAFE,GAQN,UARM;EAGA,UAAA;;AAKN;EACE,WAAA"}
1
+ {"version":3,"sources":["testweb/sourcemaps/basic.less","testweb/sourcemaps/imported.css"],"names":[],"mappings":"AAMA;EACE,YAAA;EAJA,UAAA;EAWA,iBAAA;EALA,WAAA;EACA,mBAAA;;AAJF,EASE;AATF,EASM;EACF,gBAAA;;AACA,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFA;AAEF,EAFE,GAEA,KAFJ;AAEE,EAFE,GAEA,KAFA;EAGA,UAAA;;AALN;AAAI;AAUJ;EATE,iBAAA;;AADF,EAEE;AAFE,EAEF;AAFF,EAEM;AAFF,EAEE;AAQN,OARE;AAQF,OARM;EACF,gBAAA;;AACA,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFA;AAEF,EAFF,GAEI,KAFA;AAEF,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFA;AAEF,EAFF,GAEI,KAFA;AAEF,EAFE,GAEA,KAFJ;AAEE,EAFE,GAEA,KAFJ;AAEE,EAFE,GAEA,KAFA;AAEF,EAFE,GAEA,KAFA;AAEF,EAFE,GAEA,KAFJ;AAEE,EAFE,GAEA,KAFJ;AAEE,EAFE,GAEA,KAFA;AAEF,EAFE,GAEA,KAFA;AAQN,OARE,GAQF,UARE;AAQF,OARE,GAEI,KAFJ;AAQF,OARE,GAQF,UARM;AAQN,OARE,GAEI,KAFA;AAEF,EAFF,GAQF,UARE;AAEE,EAFF,GAQF,UARM;AAQN,OARM,GAQN,UARE;AAQF,OARM,GAEA,KAFJ;AAQF,OARM,GAQN,UARM;AAQN,OARM,GAEA,KAFA;AAEF,EAFE,GAQN,UARE;AAEE,EAFE,GAQN,UARM;EAGA,UAAA;;AAKN;EACE,WAAA;;ACxBF;AACA;AACA;AACA;AACA;AACA;AACA","file":"sourcemaps/basic.css"}
@@ -21,6 +21,10 @@
21
21
  <link id="original-less:test-less-comments" title="test-less-comments" rel="stylesheet/less" type="text/css" href="../../test/less/comments.less">
22
22
  <link id="expected-less:test-less-comments" rel="stylesheet" type="text/css" href="../../test/css/comments.css">
23
23
 
24
+ <!-- the tags to be generated -->
25
+ <link id="original-less:test-less-comments2" title="test-less-comments2" rel="stylesheet/less" type="text/css" href="../../test/less/comments2.less">
26
+ <link id="expected-less:test-less-comments2" rel="stylesheet" type="text/css" href="../../test/css/comments2.css">
27
+
24
28
  <!-- the tags to be generated -->
25
29
  <link id="original-less:test-less-css-3" title="test-less-css-3" rel="stylesheet/less" type="text/css" href="../../test/less/css-3.less">
26
30
  <link id="expected-less:test-less-css-3" rel="stylesheet" type="text/css" href="../../test/css/css-3.css">