less 3.0.0-pre.2 → 3.0.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.
- package/.eslintrc.json +88 -0
- package/.github/stale.yml +17 -0
- package/.project +17 -0
- package/.settings/org.eclipse.buildship.core.prefs +2 -0
- package/.travis.yml +22 -3
- package/.vscode/launch.json +14 -0
- package/CHANGELOG.md +27 -0
- package/Gruntfile.js +191 -86
- package/README.md +5 -7
- package/appveyor.yml +9 -10
- package/bin/lessc +37 -50
- package/dist/less.js +1357 -1269
- package/dist/less.min.js +7 -7
- package/lib/less/contexts.js +20 -16
- package/lib/less/default-options.js +65 -0
- package/lib/less/environment/abstract-file-manager.js +13 -14
- package/lib/less/environment/abstract-plugin-loader.js +45 -36
- package/lib/less/environment/environment.js +5 -0
- package/lib/less/functions/boolean.js +15 -0
- package/lib/less/functions/color.js +54 -24
- package/lib/less/functions/data-uri.js +5 -2
- package/lib/less/functions/function-registry.js +1 -1
- package/lib/less/functions/index.js +2 -1
- package/lib/less/functions/number.js +2 -2
- package/lib/less/functions/string.js +2 -2
- package/lib/less/functions/svg.js +4 -4
- package/lib/less/import-manager.js +41 -29
- package/lib/less/index.js +28 -3
- package/lib/less/less-error.js +112 -13
- package/lib/less/parse.js +18 -15
- package/lib/less/parser/parser-input.js +4 -4
- package/lib/less/parser/parser.js +208 -114
- package/lib/less/plugin-manager.js +8 -33
- package/lib/less/render.js +6 -2
- package/lib/less/source-map-builder.js +3 -0
- package/lib/less/source-map-output.js +13 -8
- package/lib/less/transform-tree.js +2 -2
- package/lib/less/tree/anonymous.js +4 -1
- package/lib/less/tree/atrule.js +7 -6
- package/lib/less/tree/call.js +25 -3
- package/lib/less/tree/color.js +2 -2
- package/lib/less/tree/debug-info.js +1 -1
- package/lib/less/tree/declaration.js +6 -5
- package/lib/less/tree/dimension.js +4 -1
- package/lib/less/tree/extend.js +2 -2
- package/lib/less/tree/import.js +17 -9
- package/lib/less/tree/index.js +3 -7
- package/lib/less/tree/js-eval-node.js +1 -1
- package/lib/less/tree/media.js +3 -14
- package/lib/less/tree/mixin-definition.js +3 -3
- package/lib/less/tree/node.js +9 -6
- package/lib/less/tree/operation.js +1 -1
- package/lib/less/tree/property.js +70 -0
- package/lib/less/tree/quoted.js +11 -10
- package/lib/less/tree/ruleset.js +115 -71
- package/lib/less/tree/selector.js +38 -23
- package/lib/less/tree/unit.js +1 -1
- package/lib/less/tree/value.js +6 -1
- package/lib/less/tree/{ruleset-call.js → variable-call.js} +5 -5
- package/lib/less/tree/variable.js +6 -6
- package/lib/less/utils.js +40 -0
- package/lib/less/visitors/extend-visitor.js +14 -14
- package/lib/less/visitors/import-visitor.js +2 -2
- package/lib/less/visitors/join-selector-visitor.js +1 -1
- package/lib/less/visitors/to-css-visitor.js +51 -84
- package/lib/less/visitors/visitor.js +15 -15
- package/lib/less-browser/bootstrap.js +21 -5
- package/lib/less-browser/cache.js +2 -2
- package/lib/less-browser/error-reporting.js +5 -5
- package/lib/less-browser/file-manager.js +27 -35
- package/lib/less-browser/index.js +12 -17
- package/lib/less-browser/plugin-loader.js +8 -45
- package/lib/less-browser/utils.js +1 -1
- package/lib/less-node/file-manager.js +99 -69
- package/lib/less-node/fs.js +1 -1
- package/lib/less-node/image-size.js +2 -2
- package/lib/less-node/index.js +7 -57
- package/lib/less-node/lessc-helper.js +38 -38
- package/lib/less-node/plugin-loader.js +18 -79
- package/lib/less-node/url-file-manager.js +1 -1
- package/lib/less-rhino/index.js +29 -44
- package/package.json +16 -9
- package/test/browser/common.js +54 -18
- package/test/browser/css/plugin/plugin.css +3 -0
- package/test/browser/jasmine-jsreporter.js +4 -4
- package/test/browser/less/plugin/plugin.js +7 -0
- package/test/browser/less/plugin/plugin.less +4 -0
- package/test/browser/less.js +11685 -13
- package/test/browser/runner-browser-options.js +6 -1
- package/test/browser/runner-filemanagerPlugin-options.js +3 -2
- package/test/browser/runner-legacy-options.js +2 -1
- package/test/browser/runner-main-options.js +0 -1
- package/test/browser/runner-modify-vars-spec.js +2 -2
- package/test/browser/test-runner-template.tmpl +38 -14
- package/test/copy-bom.js +1 -1
- package/test/css/calc.css +5 -0
- package/test/css/comments2.css +1 -1
- package/test/css/compression/compression.css +1 -1
- package/test/css/css-grid.css +11 -0
- package/test/css/debug/linenumbers-all.css +0 -1
- package/test/css/debug/linenumbers-comments.css +0 -1
- package/test/css/debug/linenumbers-mediaquery.css +0 -1
- package/test/css/functions.css +16 -3
- package/test/css/import-module.css +9 -0
- package/test/css/import.css +0 -1
- package/test/css/legacy/legacy.css +1 -1
- package/test/css/merge.css +5 -4
- package/test/css/plugin-module.css +1 -0
- package/test/css/plugin.css +20 -0
- package/test/css/property-accessors.css +49 -0
- package/test/css/{css.css → strict-math/css.css} +0 -0
- package/test/css/{mixins-args.css → strict-math/mixins-args.css} +0 -0
- package/test/css/{parens.css → strict-math/parens.css} +0 -0
- package/test/import-module/one/1.less +3 -0
- package/test/import-module/one/two/2.less +3 -0
- package/test/import-module/one/two/three/3.less +3 -0
- package/test/import-module/package.json +11 -0
- package/test/index.js +55 -49
- package/test/less/calc.less +7 -0
- package/test/less/css-grid.less +15 -0
- package/test/less/detached-rulesets.less +2 -2
- package/test/less/errors/color-invalid-hex-code.less +1 -0
- package/test/less/errors/color-invalid-hex-code.txt +1 -1
- package/test/less/errors/color-invalid-hex-code2.less +1 -0
- package/test/less/errors/color-invalid-hex-code2.txt +1 -1
- package/test/less/errors/import-missing.txt +1 -1
- package/test/less/errors/plugin/plugin-error-2.js +5 -0
- package/test/less/errors/plugin/plugin-error-3.js +5 -0
- package/test/less/errors/plugin/plugin-error.js +1 -0
- package/test/less/errors/plugin-1.less +1 -0
- package/test/less/errors/plugin-1.txt +2 -0
- package/test/less/errors/plugin-2.less +1 -0
- package/test/less/errors/plugin-2.txt +5 -0
- package/test/less/errors/plugin-3.less +1 -0
- package/test/less/errors/plugin-3.txt +5 -0
- package/test/less/functions.less +18 -0
- package/test/less/import-module.less +3 -0
- package/test/less/import.less +0 -2
- package/test/less/legacy/legacy.less +1 -1
- package/test/less/media.less +2 -2
- package/test/less/merge.less +6 -3
- package/test/less/plugin/plugin-collection.js +9 -0
- package/test/less/plugin/plugin-local.js +2 -2
- package/test/less/plugin/plugin-scope1.js +3 -0
- package/test/less/plugin/plugin-scope2.js +3 -0
- package/test/less/plugin/plugin-simple.js +7 -0
- package/test/less/plugin/plugin-tree-nodes.js +33 -31
- package/test/less/plugin-module.less +7 -0
- package/test/less/plugin.less +33 -3
- package/test/less/property-accessors.less +67 -0
- package/test/less/root-registry/file.less +1 -0
- package/test/less/root-registry/root.less +3 -0
- package/test/less/{css.less → strict-math/css.less} +0 -0
- package/test/less/{mixins-args.less → strict-math/mixins-args.less} +0 -0
- package/test/less/{parens.less → strict-math/parens.less} +0 -0
- package/test/less-bom/calc.less +7 -0
- package/test/less-bom/css-grid.less +15 -0
- package/test/less-bom/detached-rulesets.less +2 -2
- package/test/less-bom/errors/color-invalid-hex-code.less +1 -0
- package/test/less-bom/errors/color-invalid-hex-code.txt +1 -1
- package/test/less-bom/errors/color-invalid-hex-code2.less +1 -0
- package/test/less-bom/errors/color-invalid-hex-code2.txt +1 -1
- package/test/less-bom/errors/import-missing.txt +1 -1
- package/test/less-bom/errors/plugin/plugin-error-2.js +5 -0
- package/test/less-bom/errors/plugin/plugin-error-3.js +5 -0
- package/test/less-bom/errors/plugin/plugin-error.js +1 -0
- package/test/less-bom/errors/plugin-1.less +1 -0
- package/test/less-bom/errors/plugin-1.txt +2 -0
- package/test/less-bom/errors/plugin-2.less +1 -0
- package/test/less-bom/errors/plugin-2.txt +5 -0
- package/test/less-bom/errors/plugin-3.less +1 -0
- package/test/less-bom/errors/plugin-3.txt +5 -0
- package/test/less-bom/functions.less +18 -0
- package/test/less-bom/import-module.less +3 -0
- package/test/less-bom/import.less +0 -2
- package/test/less-bom/legacy/legacy.less +1 -1
- package/test/less-bom/media.less +2 -2
- package/test/less-bom/merge.less +6 -3
- package/test/less-bom/plugin/plugin-collection.js +9 -0
- package/test/less-bom/plugin/plugin-local.js +2 -2
- package/test/less-bom/plugin/plugin-scope1.js +3 -0
- package/test/less-bom/plugin/plugin-scope2.js +3 -0
- package/test/less-bom/plugin/plugin-simple.js +7 -0
- package/test/less-bom/plugin/plugin-tree-nodes.js +33 -31
- package/test/less-bom/plugin-module.less +7 -0
- package/test/less-bom/plugin.less +33 -3
- package/test/less-bom/property-accessors.less +67 -0
- package/test/less-bom/root-registry/file.less +1 -0
- package/test/less-bom/root-registry/root.less +3 -0
- package/test/less-bom/{css.less → strict-math/css.less} +0 -0
- package/test/less-bom/{mixins-args.less → strict-math/mixins-args.less} +0 -0
- package/test/less-bom/{parens.less → strict-math/parens.less} +0 -0
- package/test/less-test.js +75 -17
- package/test/modify-vars.js +1 -1
- package/test/plugins/visitor/index.js +1 -1
- package/.jscsrc +0 -73
- package/.jshintrc +0 -11
- package/lib/less/tree/alpha.js +0 -28
- package/lib/less/tree/directive.js +0 -12
- package/lib/less/tree/rule.js +0 -12
- package/test/less/errors/functions-2-alpha.less +0 -2
- package/test/less/errors/functions-2-alpha.txt +0 -3
- package/test/less-bom/errors/functions-2-alpha.less +0 -2
- package/test/less-bom/errors/functions-2-alpha.txt +0 -3
- package/test/sourcemaps/maps/import-map.map +0 -1
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
var less = {
|
|
1
|
+
var less = {
|
|
2
|
+
logLevel: 4,
|
|
3
|
+
errorReporting: "console",
|
|
4
|
+
javascriptEnabled: true,
|
|
5
|
+
strictMath: false
|
|
6
|
+
};
|
|
2
7
|
|
|
3
8
|
// There originally run inside describe method. However, since they have not
|
|
4
9
|
// been inside it, they run at jasmine compile time (not runtime). It all
|
|
@@ -2,7 +2,29 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8">
|
|
5
|
+
<script>
|
|
6
|
+
// allow sauce to query for the jasmine report
|
|
7
|
+
// because we have to load the page before starting the test, so the thing
|
|
8
|
+
// sauce queries for might not be setup yet
|
|
9
|
+
var JASMINE;
|
|
10
|
+
if(Object.defineProperty) {
|
|
11
|
+
Object.defineProperty(window, 'jasmine', {
|
|
12
|
+
get: function() { return JASMINE; },
|
|
13
|
+
set: function(jsm) {
|
|
14
|
+
JASMINE = jsm || {};
|
|
15
|
+
if(!JASMINE.getJSReport || typeof JASMINE.getJSReport !== 'function') {
|
|
16
|
+
JASMINE.getJSReport = function() { };
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
window.jasmine = { getJSReport: function() { } };
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
25
|
+
|
|
5
26
|
<title>Jasmine Spec Runner</title>
|
|
27
|
+
|
|
6
28
|
<!-- generate script tags for tests -->
|
|
7
29
|
<% var generateScriptTags = function(allScripts) { allScripts.forEach(function(script){ %>
|
|
8
30
|
<script src="<%= script %>"></script>
|
|
@@ -56,27 +78,29 @@
|
|
|
56
78
|
document.body.appendChild(script);
|
|
57
79
|
};
|
|
58
80
|
|
|
59
|
-
|
|
60
|
-
// allow sauce to query for the jasmine report
|
|
61
|
-
// because we have to load the page before starting the test, so the thing
|
|
62
|
-
// sauce queries for might not be setup yet
|
|
63
|
-
window.jasmine = { getJSReport: function() { } };
|
|
64
|
-
setTimeout(function() {
|
|
65
|
-
var jasmine = <% toArray([].concat(scripts.polyfills, scripts.jasmine, scripts.boot)) %>,
|
|
81
|
+
var jasmine = <% toArray([].concat(scripts.polyfills, scripts.jasmine, scripts.boot)) %>,
|
|
66
82
|
helpers = <% toArray(scripts.helpers) %>,
|
|
67
83
|
vendor = <% toArray(scripts.vendor) %>,
|
|
68
84
|
specs = <% toArray(scripts.specs) %>,
|
|
69
85
|
reporters = <% toArray([].concat(scripts.reporters)) %>,
|
|
70
|
-
|
|
86
|
+
setupScripts = jasmine.concat(helpers).concat(vendor),
|
|
87
|
+
runScripts = specs.concat(reporters);
|
|
88
|
+
</script>
|
|
89
|
+
|
|
90
|
+
<% generateScriptTags(scripts.polyfills); %>
|
|
91
|
+
<% generateScriptTags(scripts.jasmine); %>
|
|
92
|
+
<% generateScriptTags(scripts.boot); %>
|
|
93
|
+
<% generateScriptTags(scripts.helpers); %>
|
|
94
|
+
<% generateScriptTags(scripts.vendor); %>
|
|
95
|
+
|
|
96
|
+
<script>
|
|
97
|
+
setTimeout(function() {
|
|
71
98
|
|
|
72
99
|
function addNextScript() {
|
|
73
100
|
// for sauce, see above. Additional step needed between loading jasmine and loading
|
|
74
101
|
// the js reporter
|
|
75
|
-
if (
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
if (allScripts.length) {
|
|
79
|
-
var scriptSrc = allScripts.shift();
|
|
102
|
+
if (runScripts.length) {
|
|
103
|
+
var scriptSrc = runScripts.shift();
|
|
80
104
|
loadScript(scriptSrc, addNextScript);
|
|
81
105
|
} else {
|
|
82
106
|
window.onload();
|
|
@@ -91,4 +115,4 @@
|
|
|
91
115
|
<body>
|
|
92
116
|
<!-- content -->
|
|
93
117
|
</body>
|
|
94
|
-
</html>
|
|
118
|
+
</html>
|
package/test/copy-bom.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*jshint latedef: nofunc */
|
|
1
|
+
/* jshint latedef: nofunc */
|
|
2
2
|
|
|
3
3
|
// This is used to copy a folder (the test/less/* files & sub-folders), adding a BOM to the start of each LESS and CSS file.
|
|
4
4
|
// This is a based on the copySync method from fs-extra (https://github.com/jprichardson/node-fs-extra/).
|
package/test/css/comments2.css
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#colours{color1:#fea;color2:#ffeeaa;color3:rgba(255,238,170,0.1);string:"#fea";/*! but not this type
|
|
2
2
|
Note preserved whitespace
|
|
3
|
-
*/}dimensions{val
|
|
3
|
+
*/}dimensions{val:0.1px;val:0em;val:4cm;val:0.2;val:5;angles-must-have-unit:0deg;durations-must-have-unit:0s;length-doesnt-have-unit:0px;width:auto\9}@page{marks:none;@top-left-corner{vertical-align:top}@top-left{vertical-align:top}}.shadow^.dom,body^^.shadow{display:done}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
.wrapper {
|
|
2
|
+
display: grid;
|
|
3
|
+
grid-template-columns: [col1-start] 9fr [col1-end] 10px [col2-start] 3fr [col2-end];
|
|
4
|
+
grid-template-rows: auto;
|
|
5
|
+
}
|
|
6
|
+
.wrapper {
|
|
7
|
+
display: grid;
|
|
8
|
+
grid-template-columns: 9fr 1.875em 3fr;
|
|
9
|
+
grid-template-rows: auto;
|
|
10
|
+
grid-template-areas: "header header header" "content . sidebar" "footer footer footer";
|
|
11
|
+
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
/* line 1, {pathimport}test.less */
|
|
3
3
|
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\000031}}
|
|
4
4
|
/* @charset "ISO-8859-1"; */
|
|
5
|
-
|
|
6
5
|
/* line 23, {pathimport}test.less */
|
|
7
6
|
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\0000323}}
|
|
8
7
|
.tst3 {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\000031}}
|
|
3
3
|
/* @charset "ISO-8859-1"; */
|
|
4
|
-
|
|
5
4
|
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\0000323}}
|
|
6
5
|
.tst3 {
|
|
7
6
|
color: grey;
|
package/test/css/functions.css
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
saturate-filter: saturate(5%);
|
|
39
39
|
contrast-white: #000000;
|
|
40
40
|
contrast-black: #ffffff;
|
|
41
|
-
contrast-red: #
|
|
41
|
+
contrast-red: #ffffff;
|
|
42
42
|
contrast-green: #000000;
|
|
43
43
|
contrast-blue: #ffffff;
|
|
44
44
|
contrast-yellow: #000000;
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
contrast-light-thresh: #111111;
|
|
50
50
|
contrast-dark-thresh: #eeeeee;
|
|
51
51
|
contrast-high-thresh: #eeeeee;
|
|
52
|
-
contrast-low-thresh: #
|
|
52
|
+
contrast-low-thresh: #111111;
|
|
53
53
|
contrast-light-thresh-per: #111111;
|
|
54
54
|
contrast-dark-thresh-per: #eeeeee;
|
|
55
55
|
contrast-high-thresh-per: #eeeeee;
|
|
56
|
-
contrast-low-thresh-per: #
|
|
56
|
+
contrast-low-thresh-per: #111111;
|
|
57
57
|
replace: "Hello, World!";
|
|
58
58
|
replace-captured: "This is a new string.";
|
|
59
59
|
replace-with-flags: "2 + 2 = 4";
|
|
@@ -199,3 +199,16 @@
|
|
|
199
199
|
html {
|
|
200
200
|
color: #8080ff;
|
|
201
201
|
}
|
|
202
|
+
#boolean {
|
|
203
|
+
a: true;
|
|
204
|
+
b: false;
|
|
205
|
+
c: false;
|
|
206
|
+
}
|
|
207
|
+
#if {
|
|
208
|
+
a: 1;
|
|
209
|
+
b: 2;
|
|
210
|
+
c: 3;
|
|
211
|
+
e: ;
|
|
212
|
+
f: 6;
|
|
213
|
+
/* results in void */
|
|
214
|
+
}
|
package/test/css/import.css
CHANGED
package/test/css/merge.css
CHANGED
|
@@ -10,16 +10,17 @@
|
|
|
10
10
|
background: url(data://img1.png);
|
|
11
11
|
}
|
|
12
12
|
.test4 {
|
|
13
|
-
transform: rotate(90deg), skew(30deg);
|
|
14
|
-
transform: scale(2, 4) !important;
|
|
13
|
+
transform: rotate(90deg), skew(30deg), scale(2, 4) !important;
|
|
15
14
|
}
|
|
16
15
|
.test5 {
|
|
17
|
-
transform: rotate(90deg), skew(30deg);
|
|
18
|
-
transform: scale(2, 4) !important;
|
|
16
|
+
transform: rotate(90deg), skew(30deg), scale(2, 4) !important;
|
|
19
17
|
}
|
|
20
18
|
.test6 {
|
|
21
19
|
transform: scale(2, 4);
|
|
22
20
|
}
|
|
21
|
+
.test7 {
|
|
22
|
+
transform: scale(2, 4), scale(2, 4), scale(2, 4) !important;
|
|
23
|
+
}
|
|
23
24
|
.test-interleaved {
|
|
24
25
|
transform: t1, t2, t3;
|
|
25
26
|
background: b1, b2, b3;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a{background:0 0}
|
package/test/css/plugin.css
CHANGED
|
@@ -46,4 +46,24 @@
|
|
|
46
46
|
.root {
|
|
47
47
|
prop: value;
|
|
48
48
|
}
|
|
49
|
+
.test-empty {
|
|
50
|
+
val1: foo;
|
|
51
|
+
val2: foo;
|
|
52
|
+
}
|
|
53
|
+
.test-simple {
|
|
54
|
+
value: 3.141592653589793;
|
|
55
|
+
value: 6.28318531;
|
|
56
|
+
}
|
|
57
|
+
.test-conflicts {
|
|
58
|
+
value: foo;
|
|
59
|
+
}
|
|
60
|
+
.test-conflicts {
|
|
61
|
+
value: bar;
|
|
62
|
+
}
|
|
63
|
+
.test-conflicts {
|
|
64
|
+
value: foo;
|
|
65
|
+
}
|
|
66
|
+
.test-collection {
|
|
67
|
+
list: 32, 5, "bird";
|
|
68
|
+
}
|
|
49
69
|
@arbitrary value after ();
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
.block_1 {
|
|
2
|
+
color: red;
|
|
3
|
+
background-color: red;
|
|
4
|
+
width: 50px;
|
|
5
|
+
height: 25px;
|
|
6
|
+
border: 1px solid #ff3333;
|
|
7
|
+
content: "red";
|
|
8
|
+
prop: red;
|
|
9
|
+
}
|
|
10
|
+
.block_1:hover {
|
|
11
|
+
background-color: green;
|
|
12
|
+
color: green;
|
|
13
|
+
}
|
|
14
|
+
.block_1 .one {
|
|
15
|
+
background: red;
|
|
16
|
+
}
|
|
17
|
+
.block_2 {
|
|
18
|
+
color: red;
|
|
19
|
+
color: blue;
|
|
20
|
+
}
|
|
21
|
+
.block_2 .two {
|
|
22
|
+
background-color: blue;
|
|
23
|
+
}
|
|
24
|
+
.block_3 {
|
|
25
|
+
color: red;
|
|
26
|
+
color: yellow;
|
|
27
|
+
color: blue;
|
|
28
|
+
}
|
|
29
|
+
.block_3 .three {
|
|
30
|
+
background-color: blue;
|
|
31
|
+
}
|
|
32
|
+
.block_4 {
|
|
33
|
+
color: red;
|
|
34
|
+
color: blue;
|
|
35
|
+
color: yellow;
|
|
36
|
+
}
|
|
37
|
+
.block_4 .four {
|
|
38
|
+
background-color: yellow;
|
|
39
|
+
}
|
|
40
|
+
a {
|
|
41
|
+
background-color: red, foo;
|
|
42
|
+
}
|
|
43
|
+
ab {
|
|
44
|
+
background: red, foo;
|
|
45
|
+
}
|
|
46
|
+
.value_as_property {
|
|
47
|
+
prop1: color;
|
|
48
|
+
color: #FF0000;
|
|
49
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "import-module",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Less files to be included in node_modules directory for testing import from node_modules",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"author": "Rob Huzzey <robert.huzzey@holidayextras.com>",
|
|
10
|
+
"license": "ISC"
|
|
11
|
+
}
|
package/test/index.js
CHANGED
|
@@ -3,58 +3,64 @@ var lessTest = require("./less-test"),
|
|
|
3
3
|
path = require("path"),
|
|
4
4
|
stylize = require('../lib/less-node/lessc-helper').stylize;
|
|
5
5
|
|
|
6
|
-
function getErrorPathReplacementFunction(dir) {
|
|
7
|
-
return function(input, baseDir) {
|
|
8
|
-
return input.replace(/\{path\}/g, path.join(process.cwd(), baseDir, dir + "/"))
|
|
9
|
-
.replace(/\{node\}/g, "")
|
|
10
|
-
.replace(/\{\/node\}/g, "")
|
|
11
|
-
.replace(/\{pathrel\}/g, path.join(baseDir, dir + "/"))
|
|
12
|
-
.replace(/\{pathhref\}/g, "")
|
|
13
|
-
.replace(/\{404status\}/g, "")
|
|
14
|
-
.replace(/\r\n/g, '\n');
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
6
|
console.log("\n" + stylize("Less", 'underline') + "\n");
|
|
19
7
|
|
|
20
8
|
lessTester.prepBomTest();
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
lessTester.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
lessTester.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
9
|
+
var testMap = [
|
|
10
|
+
[{
|
|
11
|
+
strictMath: false,
|
|
12
|
+
relativeUrls: true,
|
|
13
|
+
silent: true,
|
|
14
|
+
javascriptEnabled: true,
|
|
15
|
+
// Set explicitly for legacy tests for >3.0
|
|
16
|
+
ieCompat: true
|
|
17
|
+
}],
|
|
18
|
+
[{
|
|
19
|
+
strictMath: true,
|
|
20
|
+
ieCompat: true
|
|
21
|
+
}, "strict-math/"],
|
|
22
|
+
[{strictMath: true, strictUnits: true, javascriptEnabled: true}, "errors/",
|
|
23
|
+
lessTester.testErrors, null],
|
|
24
|
+
[{strictMath: true, strictUnits: true, javascriptEnabled: false}, "no-js-errors/",
|
|
25
|
+
lessTester.testErrors, null],
|
|
26
|
+
[{strictMath: true, dumpLineNumbers: 'comments'}, "debug/", null,
|
|
27
|
+
function(name) { return name + '-comments'; }],
|
|
28
|
+
[{strictMath: true, dumpLineNumbers: 'mediaquery'}, "debug/", null,
|
|
29
|
+
function(name) { return name + '-mediaquery'; }],
|
|
30
|
+
[{strictMath: true, dumpLineNumbers: 'all'}, "debug/", null,
|
|
31
|
+
function(name) { return name + '-all'; }],
|
|
32
|
+
[{strictMath: true, relativeUrls: false, rootpath: "folder (1)/"}, "static-urls/"],
|
|
33
|
+
[{strictMath: true, compress: true}, "compression/"],
|
|
34
|
+
[{strictMath: false, strictUnits: true}, "strict-units/"],
|
|
35
|
+
[{}, "legacy/"],
|
|
36
|
+
[{strictMath: true, strictUnits: true, sourceMap: true, globalVars: true }, "sourcemaps/",
|
|
37
|
+
lessTester.testSourcemap, null, null,
|
|
38
|
+
function(filename, type, baseFolder) {
|
|
39
|
+
if (type === "vars") {
|
|
40
|
+
return path.join(baseFolder, filename) + '.json';
|
|
41
|
+
}
|
|
42
|
+
return path.join('test/sourcemaps', filename) + '.json';
|
|
43
|
+
}],
|
|
44
|
+
[{strictMath: true, strictUnits: true, sourceMap: {sourceMapFileInline: true}},
|
|
45
|
+
"sourcemaps-empty/", lessTester.testEmptySourcemap],
|
|
46
|
+
[{globalVars: true, banner: "/**\n * Test\n */\n"}, "globalVars/",
|
|
47
|
+
null, null, null, function(name, type, baseFolder) { return path.join(baseFolder, name) + '.json'; }],
|
|
48
|
+
[{modifyVars: true}, "modifyVars/",
|
|
49
|
+
null, null, null, function(name, type, baseFolder) { return path.join(baseFolder, name) + '.json'; }],
|
|
50
|
+
[{urlArgs: '424242'}, "url-args/"],
|
|
51
|
+
[{paths: ['test/data/', 'test/less/import/']}, "include-path/"],
|
|
52
|
+
[{paths: 'test/data/'}, "include-path-string/"],
|
|
53
|
+
[{plugin: 'test/plugins/postprocess/'}, "postProcessorPlugin/"],
|
|
54
|
+
[{plugin: 'test/plugins/preprocess/'}, "preProcessorPlugin/"],
|
|
55
|
+
[{plugin: 'test/plugins/visitor/'}, "visitorPlugin/"],
|
|
56
|
+
[{plugin: 'test/plugins/filemanager/'}, "filemanagerPlugin/"],
|
|
57
|
+
[{}, "no-strict-math/"]
|
|
58
|
+
];
|
|
59
|
+
testMap.forEach(function(args) {
|
|
60
|
+
lessTester.runTestSet.apply(lessTester, args)
|
|
61
|
+
});
|
|
57
62
|
lessTester.testSyncronous({syncImport: true}, "import");
|
|
58
|
-
lessTester.testSyncronous({syncImport: true}, "css");
|
|
63
|
+
lessTester.testSyncronous({syncImport: true}, "strict-math/css");
|
|
59
64
|
lessTester.testNoOptions();
|
|
65
|
+
lessTester.testJSImport();
|
|
60
66
|
lessTester.finished();
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.wrapper {
|
|
2
|
+
display: grid;
|
|
3
|
+
grid-template-columns: [col1-start] 9fr [col1-end] 10px [col2-start] 3fr [col2-end];
|
|
4
|
+
grid-template-rows: auto;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.wrapper {
|
|
8
|
+
display: grid;
|
|
9
|
+
grid-template-columns: 9fr 1.875em 3fr;
|
|
10
|
+
grid-template-rows: auto;
|
|
11
|
+
grid-template-areas:
|
|
12
|
+
"header header header"
|
|
13
|
+
"content . sidebar"
|
|
14
|
+
"footer footer footer";
|
|
15
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
FileError: '{pathhref}file-does-not-exist.less' wasn't found{404status}{node}. Tried - {path}file-does-not-exist.less,{pathrel}file-does-not-exist.less,file-does-not-exist.less{/node} in {path}import-missing.less on line 6, column 1:
|
|
1
|
+
FileError: '{pathhref}file-does-not-exist.less' wasn't found{404status}{node}. Tried - {path}file-does-not-exist.less,{pathrel}file-does-not-exist.less,{nodepath}file-does-not-exist.less,file-does-not-exist.less{/node} in {path}import-missing.less on line 6, column 1:
|
|
2
2
|
5
|
|
3
3
|
6 @import "file-does-not-exist.less";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
throw new Error('Error');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@plugin "plugin/plugin-error";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@plugin "plugin/plugin-error-2";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@plugin "plugin/plugin-error-3";
|