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.
- package/.grunt/grunt-contrib-jasmine/es5-shim.js +1360 -0
- package/.idea/jsLibraryMappings.xml +0 -1
- package/.idea/workspace.xml +182 -183
- package/.travis.yml +0 -1
- package/CHANGELOG.md +60 -2
- package/CONTRIBUTING.md +1 -1
- package/Gruntfile.js +12 -24
- package/LICENSE +0 -2
- package/README.md +5 -3
- package/benchmark/less-benchmark.js +1 -2
- package/bin/lessc +13 -11
- package/bower.json +2 -2
- package/build/rhino-modules.js +1 -1
- package/dist/less-1.7.0.js +59 -59
- package/dist/less-1.7.0.min.js +12 -12
- package/dist/less-1.7.1.js +7936 -0
- package/dist/less-1.7.1.min.js +16 -0
- package/dist/less-1.7.2.js +7938 -0
- package/dist/less-1.7.2.min.js +16 -0
- package/dist/less-1.7.3.js +7942 -0
- package/dist/less-1.7.3.min.js +16 -0
- package/dist/less-1.7.4.js +7979 -0
- package/dist/less-1.7.4.min.js +16 -0
- package/dist/less-1.7.5.js +8008 -0
- package/dist/less-1.7.5.min.js +16 -0
- package/dist/less-rhino-1.7.0.js +48 -48
- package/dist/less-rhino-1.7.1.js +9311 -0
- package/dist/less-rhino-1.7.2.js +9313 -0
- package/dist/less-rhino-1.7.3.js +9317 -0
- package/dist/less-rhino-1.7.4.js +9354 -0
- package/dist/less-rhino-1.7.5.js +9383 -0
- package/dist/lessc-rhino-1.7.0.js +2 -2
- package/dist/lessc-rhino-1.7.1.js +449 -0
- package/dist/lessc-rhino-1.7.2.js +449 -0
- package/dist/lessc-rhino-1.7.3.js +449 -0
- package/dist/lessc-rhino-1.7.4.js +449 -0
- package/dist/lessc-rhino-1.7.5.js +449 -0
- package/lib/less/browser.js +14 -9
- package/lib/less/env.js +2 -0
- package/lib/less/fs.js +10 -0
- package/lib/less/functions.js +41 -38
- package/lib/less/import-visitor.js +9 -7
- package/lib/less/index.js +30 -18
- package/lib/less/lessc_helper.js +1 -0
- package/lib/less/parser/parser.js.orig +1747 -0
- package/lib/less/parser.js +81 -40
- package/lib/less/rhino.js +3 -3
- package/lib/less/source-map-output.js +1 -1
- package/lib/less/to-css-visitor.js +3 -0
- package/lib/less/tree/anonymous.js +7 -3
- package/lib/less/tree/directive.js +6 -0
- package/lib/less/tree/element.js +6 -22
- package/lib/less/tree/import.js +1 -1
- package/lib/less/tree/mixin.js +4 -3
- package/lib/less/tree/quoted.js +12 -4
- package/lib/less/tree/rule.js +7 -4
- package/lib/less/tree/rule.js.orig +164 -0
- package/lib/less/tree/ruleset.js +27 -2
- package/lib/less/tree/selector.js +1 -1
- package/lib/less/tree.js +2 -2
- package/package.json +13 -12
- package/test/browser/less.js +7317 -6931
- package/test/css/comments.css +8 -0
- package/test/css/css-3.css +9 -0
- package/test/css/functions.css +8 -8
- package/test/css/import-inline.css +4 -1
- package/test/css/import.css +6 -0
- package/test/css/javascript.css +5 -0
- package/test/css/mixins-guards.css +14 -3
- package/test/css/mixins.css +3 -0
- package/test/css/property-name-interp.css +1 -0
- package/test/css/urls.css +6 -0
- package/test/index.js +1 -1
- package/test/less/comments.less +14 -1
- package/test/less/css-3.less +12 -1
- package/test/less/errors/color-invalid-hex-code.less +3 -0
- package/test/less/errors/color-invalid-hex-code.txt +4 -0
- package/test/less/errors/color-invalid-hex-code2.less +3 -0
- package/test/less/errors/color-invalid-hex-code2.txt +4 -0
- package/test/less/errors/import-malformed.less +1 -0
- package/test/less/errors/import-malformed.txt +3 -0
- package/test/less/errors/import-no-semi.txt +1 -1
- package/test/less/errors/javascript-error.less +1 -1
- package/test/less/errors/javascript-error.txt +2 -2
- package/test/less/import-inline.less +1 -0
- package/test/less/import.less +8 -1
- package/test/less/javascript.less +9 -0
- package/test/less/mixins-guards.less +17 -3
- package/test/less/mixins.less +4 -0
- package/test/less/property-name-interp.less +4 -1
- package/test/less/property-name-interp.less.orig +59 -0
- package/test/less/urls.less +12 -0
- package/test/less-test.js +7 -8
- package/test/modify-vars.js +17 -0
- package/test/sourcemaps/basic.json +1 -1
- package/tmp/browser/test-runner-main.html +4 -0
- package/tmp/less.js +8295 -0
- package/build/README.md +0 -51
- package/tmp/browser/test-postProcessor.html +0 -59
- package/tmp/browser/test-runner-browser.html +0 -59
- package/tmp/browser/test-runner-errors.html +0 -267
- package/tmp/browser/test-runner-global-vars.html +0 -59
- package/tmp/browser/test-runner-legacy.html +0 -59
- package/tmp/browser/test-runner-modify-vars.html +0 -59
- package/tmp/browser/test-runner-no-js-errors.html +0 -59
- package/tmp/browser/test-runner-production.html +0 -55
- package/tmp/browser/test-runner-relative-urls.html +0 -59
- package/tmp/browser/test-runner-rootpath-relative.html +0 -59
- package/tmp/browser/test-runner-rootpath.html +0 -59
package/test/css/comments.css
CHANGED
package/test/css/css-3.css
CHANGED
|
@@ -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
|
+
}
|
package/test/css/functions.css
CHANGED
|
@@ -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:
|
|
24
|
-
luma-blue: 7%;
|
|
25
|
-
luma-yellow:
|
|
26
|
-
luma-cyan:
|
|
27
|
-
luma-differs-from-luminance:
|
|
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;
|
package/test/css/import.css
CHANGED
|
@@ -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
|
+
}
|
package/test/css/javascript.css
CHANGED
|
@@ -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
|
|
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
|
+
}
|
package/test/css/mixins.css
CHANGED
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("
|
|
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"));
|
package/test/less/comments.less
CHANGED
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
*/
|
|
63
63
|
|
|
64
64
|
.selector /* .with */, .lots, /* of */ .comments {
|
|
65
|
-
color
|
|
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
|
|
package/test/less/css-3.less
CHANGED
|
@@ -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 @@
|
|
|
1
|
+
@import malformed "this-statement-is-invalid.less";
|
|
@@ -1,2 +1,2 @@
|
|
|
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,4 +1,4 @@
|
|
|
1
|
-
SyntaxError: JavaScript evaluation error: 'TypeError: Cannot
|
|
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 }
|
package/test/less/import.less
CHANGED
|
@@ -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 (
|
|
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);
|
package/test/less/mixins.less
CHANGED
|
@@ -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
|
}
|
|
@@ -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
|
+
}
|
package/test/less/urls.less
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
154
|
+
process.stdout.write(stylize(text, item.added ? 'green' : 'red'));
|
|
156
155
|
} else {
|
|
157
|
-
|
|
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
|
-
|
|
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,"
|
|
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">
|