less 3.7.0 → 3.9.0
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/CHANGELOG.md +32 -0
- package/Gruntfile.js +45 -7
- package/bin/lessc +24 -5
- package/dist/less.js +644 -210
- package/dist/less.min.js +7 -7
- package/lib/less/constants.js +13 -0
- package/lib/less/contexts.js +38 -10
- package/lib/less/default-options.js +1 -1
- package/lib/less/functions/color.js +84 -41
- package/lib/less/functions/data-uri.js +1 -1
- package/lib/less/functions/list.js +44 -9
- package/lib/less/import-manager.js +3 -3
- package/lib/less/index.js +1 -1
- package/lib/less/parse.js +1 -1
- package/lib/less/parser/parser.js +2 -9
- package/lib/less/source-map-output.js +2 -2
- package/lib/less/tree/color.js +58 -18
- package/lib/less/tree/declaration.js +1 -1
- package/lib/less/tree/expression.js +1 -1
- package/lib/less/tree/import.js +9 -8
- package/lib/less/tree/operation.js +1 -1
- package/lib/less/tree/url.js +12 -8
- package/lib/less/tree/variable-call.js +6 -3
- package/lib/less/utils.js +36 -26
- package/lib/less-browser/add-default-options.js +4 -0
- package/lib/less-browser/index.js +9 -2
- package/lib/less-node/image-size.js +1 -1
- package/lib/less-node/lessc-helper.js +2 -1
- package/package.json +5 -3
- package/test/browser/css/rewrite-urls/urls.css +36 -0
- package/test/browser/css/rootpath-rewrite-urls/urls.css +35 -0
- package/test/browser/less/rewrite-urls/urls.less +34 -0
- package/test/browser/less/rootpath-rewrite-urls/urls.less +33 -0
- package/test/browser/less.js +644 -210
- package/test/browser/runner-rewrite-urls-options.js +3 -0
- package/test/browser/runner-rewrite-urls-spec.js +3 -0
- package/test/browser/runner-rootpath-relative-spec.js +1 -1
- package/test/browser/runner-rootpath-rewrite-urls-options.js +4 -0
- package/test/browser/runner-rootpath-rewrite-urls-spec.js +3 -0
- package/test/css/colors.css +20 -3
- package/test/css/css-escapes.css +3 -0
- package/test/css/functions-each.css +34 -0
- package/test/css/functions.css +4 -4
- package/test/css/rewrite-urls-all/rewrite-urls-all.css +17 -0
- package/test/css/rewrite-urls-local/rewrite-urls-local.css +17 -0
- package/test/css/rootpath-rewrite-urls-all/rootpath-rewrite-urls-all.css +17 -0
- package/test/css/rootpath-rewrite-urls-local/rootpath-rewrite-urls-local.css +17 -0
- package/test/css/static-urls/urls.css +2 -2
- package/test/css/urls.css +2 -2
- package/test/index.js +8 -2
- package/test/less/colors.less +18 -0
- package/test/less/css-escapes.less +4 -0
- package/test/less/errors/color-func-invalid-color.txt +1 -1
- package/test/less/functions-each.less +51 -1
- package/test/less/rewrite-urls-all/folder/file.less +8 -0
- package/test/less/rewrite-urls-all/rewrite-urls-all.less +11 -0
- package/test/less/rewrite-urls-local/folder/file.less +8 -0
- package/test/less/rewrite-urls-local/rewrite-urls-local.less +11 -0
- package/test/less/rootpath-rewrite-urls-all/folder/file.less +8 -0
- package/test/less/rootpath-rewrite-urls-all/rootpath-rewrite-urls-all.less +11 -0
- package/test/less/rootpath-rewrite-urls-local/folder/file.less +8 -0
- package/test/less/rootpath-rewrite-urls-local/rootpath-rewrite-urls-local.less +11 -0
- package/test/less/sourcemaps/custom-props.less +8 -0
- package/test/less-bom/colors.less +18 -0
- package/test/less-bom/css-escapes.less +4 -0
- package/test/less-bom/errors/color-func-invalid-color.txt +1 -1
- package/test/less-bom/functions-each.less +51 -1
- package/test/less-bom/rewrite-urls-all/folder/file.less +8 -0
- package/test/less-bom/rewrite-urls-all/rewrite-urls-all.less +11 -0
- package/test/less-bom/rewrite-urls-local/folder/file.less +8 -0
- package/test/less-bom/rewrite-urls-local/rewrite-urls-local.less +11 -0
- package/test/less-bom/rootpath-rewrite-urls-all/folder/file.less +8 -0
- package/test/less-bom/rootpath-rewrite-urls-all/rootpath-rewrite-urls-all.less +11 -0
- package/test/less-bom/rootpath-rewrite-urls-local/folder/file.less +8 -0
- package/test/less-bom/rootpath-rewrite-urls-local/rootpath-rewrite-urls-local.less +11 -0
- package/test/less-bom/sourcemaps/custom-props.less +8 -0
- package/test/less-test.js +26 -12
- package/test/sourcemaps/custom-props.json +1 -0
- package/.npmignore +0 -8
- package/lib/less/math-constants.js +0 -6
- package/test/css/3rd-party/bootstrap.css +0 -6814
- package/test/less/3rd-party/bootstrap.less +0 -1
- package/test/less/errors/color-invalid-hex-code.less +0 -4
- package/test/less/errors/color-invalid-hex-code.txt +0 -4
- package/test/less/errors/color-invalid-hex-code2.less +0 -4
- package/test/less/errors/color-invalid-hex-code2.txt +0 -4
- package/test/less-bom/3rd-party/bootstrap.less +0 -1
- package/test/less-bom/errors/color-invalid-hex-code.less +0 -4
- package/test/less-bom/errors/color-invalid-hex-code.txt +0 -4
- package/test/less-bom/errors/color-invalid-hex-code2.less +0 -4
- package/test/less-bom/errors/color-invalid-hex-code2.txt +0 -4
package/test/css/colors.css
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
color: #1a0000ff;
|
|
24
24
|
}
|
|
25
25
|
#alpha #hsla {
|
|
26
|
-
color:
|
|
26
|
+
color: hsla(11, 20%, 20%, 0.6);
|
|
27
27
|
}
|
|
28
28
|
#overflow .a {
|
|
29
29
|
color: #000000;
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
color: #333333;
|
|
48
48
|
}
|
|
49
49
|
#808080 {
|
|
50
|
-
color:
|
|
50
|
+
color: hsl(0, 0%, 50%);
|
|
51
51
|
}
|
|
52
52
|
#00ff00 {
|
|
53
|
-
color:
|
|
53
|
+
color: hsl(120, 100%, 50%);
|
|
54
54
|
}
|
|
55
55
|
.lightenblue {
|
|
56
56
|
color: #3333ff;
|
|
@@ -85,3 +85,20 @@
|
|
|
85
85
|
color: 255;
|
|
86
86
|
border-color: rgba(255, 0, 0, 0.5);
|
|
87
87
|
}
|
|
88
|
+
#rrggbbaa {
|
|
89
|
+
test-1: #55FF5599;
|
|
90
|
+
test-2: #5F59;
|
|
91
|
+
test-3: rgba(136, 255, 136, 0.6);
|
|
92
|
+
test-4: rgba(85, 255, 85, 0.1);
|
|
93
|
+
test-5: rgba(85, 255, 85, 0.6);
|
|
94
|
+
test-6: rgba(85, 255, 85, 0.6);
|
|
95
|
+
test-7: rgba(85, 255, 85, 0.5);
|
|
96
|
+
test-8: rgba(var(--color-accent), 0.2);
|
|
97
|
+
test-9: rgb(var(--color-accent));
|
|
98
|
+
test-9: hsla(var(--color-accent));
|
|
99
|
+
test-10: #55FF5599;
|
|
100
|
+
test-11: hsla(120, 100%, 66.66666667%, 0.6);
|
|
101
|
+
test-12: hsla(120, 100%, 66.66666667%, 0.5);
|
|
102
|
+
--semi-transparent-dark-background: #001e00ee;
|
|
103
|
+
--semi-transparent-dark-background-2: #001e00;
|
|
104
|
+
}
|
package/test/css/css-escapes.css
CHANGED
|
@@ -40,9 +40,43 @@
|
|
|
40
40
|
val2: 2;
|
|
41
41
|
val3: 4;
|
|
42
42
|
}
|
|
43
|
+
.column-list {
|
|
44
|
+
list: 1 2 3 4;
|
|
45
|
+
}
|
|
46
|
+
.col-1 {
|
|
47
|
+
width: 25%;
|
|
48
|
+
}
|
|
49
|
+
.col-2 {
|
|
50
|
+
width: 25%;
|
|
51
|
+
}
|
|
52
|
+
.col-3 {
|
|
53
|
+
width: 25%;
|
|
54
|
+
}
|
|
55
|
+
.col-4 {
|
|
56
|
+
width: 25%;
|
|
57
|
+
}
|
|
58
|
+
.row-1 {
|
|
59
|
+
width: 10px;
|
|
60
|
+
}
|
|
61
|
+
.row-2 {
|
|
62
|
+
width: 20px;
|
|
63
|
+
}
|
|
64
|
+
.row-3 {
|
|
65
|
+
width: 30px;
|
|
66
|
+
}
|
|
43
67
|
.box {
|
|
44
68
|
-less-log: a;
|
|
45
69
|
-less-log: b;
|
|
46
70
|
-less-log: c;
|
|
47
71
|
-less-log: d;
|
|
48
72
|
}
|
|
73
|
+
.test {
|
|
74
|
+
color: blue;
|
|
75
|
+
color: red;
|
|
76
|
+
}
|
|
77
|
+
.foo {
|
|
78
|
+
content: red;
|
|
79
|
+
}
|
|
80
|
+
.bar {
|
|
81
|
+
content: blue;
|
|
82
|
+
}
|
package/test/css/functions.css
CHANGED
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
desaturate: #29332f;
|
|
18
18
|
desaturate-relative: #233930;
|
|
19
19
|
greyscale: #2e2e2e;
|
|
20
|
-
hsl-clamp:
|
|
21
|
-
spin-p:
|
|
22
|
-
spin-n:
|
|
20
|
+
hsl-clamp: hsl(0, 0%, 100%);
|
|
21
|
+
spin-p: hsl(20, 50%, 50%);
|
|
22
|
+
spin-n: hsl(350, 50%, 50%);
|
|
23
23
|
luma-white: 100%;
|
|
24
24
|
luma-black: 0%;
|
|
25
25
|
luma-black-alpha: 0%;
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
case-insensitive-2: true;
|
|
169
169
|
}
|
|
170
170
|
#alpha {
|
|
171
|
-
alpha:
|
|
171
|
+
alpha: hsla(25, 50%, 40%, 0.6);
|
|
172
172
|
alpha2: 0.5;
|
|
173
173
|
alpha3: 0;
|
|
174
174
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#imported-file {
|
|
2
|
+
background-image: url("./folder/relative/path");
|
|
3
|
+
background-image: url("./relative/path");
|
|
4
|
+
background-image: url("../relative/path");
|
|
5
|
+
background-image: url("folder/module");
|
|
6
|
+
background-image: url("folder/module/path");
|
|
7
|
+
background-image: url("folder/module/relative/path");
|
|
8
|
+
}
|
|
9
|
+
#rewrite-urls-all {
|
|
10
|
+
background-image: url("./relative/path");
|
|
11
|
+
background-image: url("../relative/path");
|
|
12
|
+
background-image: url("./path");
|
|
13
|
+
background-image: url("./");
|
|
14
|
+
background-image: url("module");
|
|
15
|
+
background-image: url("module/path");
|
|
16
|
+
background-image: url("module/relative/path");
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#imported-file {
|
|
2
|
+
background-image: url("./folder/relative/path");
|
|
3
|
+
background-image: url("./relative/path");
|
|
4
|
+
background-image: url("../relative/path");
|
|
5
|
+
background-image: url("module");
|
|
6
|
+
background-image: url("module/path");
|
|
7
|
+
background-image: url("module/relative/path");
|
|
8
|
+
}
|
|
9
|
+
#rewrite-urls-local {
|
|
10
|
+
background-image: url("./relative/path");
|
|
11
|
+
background-image: url("../relative/path");
|
|
12
|
+
background-image: url("./path");
|
|
13
|
+
background-image: url("./");
|
|
14
|
+
background-image: url("module");
|
|
15
|
+
background-image: url("module/path");
|
|
16
|
+
background-image: url("module/relative/path");
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#imported-file {
|
|
2
|
+
background-image: url("http://example.com/assets/css/folder/relative/path");
|
|
3
|
+
background-image: url("http://example.com/assets/css/relative/path");
|
|
4
|
+
background-image: url("http://example.com/assets/relative/path");
|
|
5
|
+
background-image: url("http://example.com/assets/css/folder/module");
|
|
6
|
+
background-image: url("http://example.com/assets/css/folder/module/path");
|
|
7
|
+
background-image: url("http://example.com/assets/css/folder/module/relative/path");
|
|
8
|
+
}
|
|
9
|
+
#rootpath-rewrite-urls-all {
|
|
10
|
+
background-image: url("http://example.com/assets/css/relative/path");
|
|
11
|
+
background-image: url("http://example.com/assets/relative/path");
|
|
12
|
+
background-image: url("http://example.com/assets/css/path");
|
|
13
|
+
background-image: url("http://example.com/assets/css");
|
|
14
|
+
background-image: url("http://example.com/assets/css/module");
|
|
15
|
+
background-image: url("http://example.com/assets/css/module/path");
|
|
16
|
+
background-image: url("http://example.com/assets/css/module/relative/path");
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#imported-file {
|
|
2
|
+
background-image: url("http://example.com/assets/css/folder/relative/path");
|
|
3
|
+
background-image: url("http://example.com/assets/css/relative/path");
|
|
4
|
+
background-image: url("http://example.com/assets/relative/path");
|
|
5
|
+
background-image: url("module");
|
|
6
|
+
background-image: url("module/path");
|
|
7
|
+
background-image: url("module/relative/path");
|
|
8
|
+
}
|
|
9
|
+
#rootpath-rewrite-urls-local {
|
|
10
|
+
background-image: url("http://example.com/assets/css/relative/path");
|
|
11
|
+
background-image: url("http://example.com/assets/relative/path");
|
|
12
|
+
background-image: url("http://example.com/assets/css/path");
|
|
13
|
+
background-image: url("http://example.com/assets/css");
|
|
14
|
+
background-image: url("module");
|
|
15
|
+
background-image: url("module/path");
|
|
16
|
+
background-image: url("module/relative/path");
|
|
17
|
+
}
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
#logo {
|
|
31
31
|
width: 100px;
|
|
32
32
|
height: 100px;
|
|
33
|
-
background: url('assets/logo.png');
|
|
33
|
+
background: url('./assets/logo.png');
|
|
34
34
|
background: url("#inline-svg");
|
|
35
35
|
}
|
|
36
36
|
@font-face {
|
|
37
37
|
font-family: xecret;
|
|
38
|
-
src: url('assets/xecret.ttf');
|
|
38
|
+
src: url('./assets/xecret.ttf');
|
|
39
39
|
}
|
|
40
40
|
#secret {
|
|
41
41
|
font-family: xecret, sans-serif;
|
package/test/css/urls.css
CHANGED
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
#logo {
|
|
39
39
|
width: 100px;
|
|
40
40
|
height: 100px;
|
|
41
|
-
background: url('import/assets/logo.png');
|
|
41
|
+
background: url('./import/assets/logo.png');
|
|
42
42
|
background: url("#inline-svg");
|
|
43
43
|
}
|
|
44
44
|
@font-face {
|
|
45
45
|
font-family: xecret;
|
|
46
|
-
src: url('import/assets/xecret.ttf');
|
|
46
|
+
src: url('./import/assets/xecret.ttf');
|
|
47
47
|
}
|
|
48
48
|
#secret {
|
|
49
49
|
font-family: xecret, sans-serif;
|
package/test/index.js
CHANGED
|
@@ -9,8 +9,9 @@ lessTester.prepBomTest();
|
|
|
9
9
|
var testMap = [
|
|
10
10
|
[{}, 'namespacing/'],
|
|
11
11
|
[{
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
// TODO: Change this to rewriteUrls: 'all' once the relativeUrls option is removed
|
|
13
|
+
relativeUrls: true,
|
|
14
|
+
silent: true,
|
|
14
15
|
javascriptEnabled: true,
|
|
15
16
|
// Set explicitly for legacy tests for >3.0
|
|
16
17
|
ieCompat: true
|
|
@@ -37,6 +38,7 @@ var testMap = [
|
|
|
37
38
|
function(name) { return name + '-mediaquery'; }],
|
|
38
39
|
[{math: 'strict', dumpLineNumbers: 'all'}, 'debug/', null,
|
|
39
40
|
function(name) { return name + '-all'; }],
|
|
41
|
+
// TODO: Change this to rewriteUrls: false once the relativeUrls option is removed
|
|
40
42
|
[{math: 'strict', relativeUrls: false, rootpath: 'folder (1)/'}, 'static-urls/'],
|
|
41
43
|
[{math: 'strict', compress: true}, 'compression/'],
|
|
42
44
|
[{math: 0, strictUnits: true}, 'strict-units/'],
|
|
@@ -56,6 +58,10 @@ var testMap = [
|
|
|
56
58
|
[{modifyVars: true}, 'modifyVars/',
|
|
57
59
|
null, null, null, function(name, type, baseFolder) { return path.join(baseFolder, name) + '.json'; }],
|
|
58
60
|
[{urlArgs: '424242'}, 'url-args/'],
|
|
61
|
+
[{rewriteUrls: 'all'}, 'rewrite-urls-all/'],
|
|
62
|
+
[{rewriteUrls: 'local'}, 'rewrite-urls-local/'],
|
|
63
|
+
[{rootpath: 'http://example.com/assets/css/', rewriteUrls: 'all'}, 'rootpath-rewrite-urls-all/'],
|
|
64
|
+
[{rootpath: 'http://example.com/assets/css/', rewriteUrls: 'local'}, 'rootpath-rewrite-urls-local/'],
|
|
59
65
|
[{paths: ['test/data/', 'test/less/import/']}, 'include-path/'],
|
|
60
66
|
[{paths: 'test/data/'}, 'include-path-string/'],
|
|
61
67
|
[{plugin: 'test/plugins/postprocess/'}, 'postProcessorPlugin/'],
|
package/test/less/colors.less
CHANGED
|
@@ -96,3 +96,21 @@
|
|
|
96
96
|
color: red(rgb(100%, 0, 0));
|
|
97
97
|
border-color: rgba(100%, 0, 0, 50%);
|
|
98
98
|
}
|
|
99
|
+
|
|
100
|
+
#rrggbbaa {
|
|
101
|
+
test-1: #55FF5599;
|
|
102
|
+
test-2: #5F59;
|
|
103
|
+
test-3: lighten(#55FF5599, 10%);
|
|
104
|
+
test-4: fade(#5F59, 10%);
|
|
105
|
+
test-5: rgba(#55FF5599);
|
|
106
|
+
test-6: rgba(#5F59);
|
|
107
|
+
test-7: rgba(#5F59, 0.5);
|
|
108
|
+
test-8: rgba(var(--color-accent), 0.2);
|
|
109
|
+
test-9: rgb(var(--color-accent));
|
|
110
|
+
test-9: hsla(var(--color-accent));
|
|
111
|
+
test-10: color('#55FF5599');
|
|
112
|
+
test-11: hsla(#5F59);
|
|
113
|
+
test-12: hsla(#5F59, 0.5);
|
|
114
|
+
--semi-transparent-dark-background: #001e00ee;
|
|
115
|
+
--semi-transparent-dark-background-2: rgba(0, 30, 0, 238); // invalid opacity will be capped
|
|
116
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
ArgumentError: error evaluating function `color`: argument must be a color keyword or 3
|
|
1
|
+
ArgumentError: error evaluating function `color`: argument must be a color keyword or 3|4|6|8 digit hex e.g. #FFF in {path}color-func-invalid-color.less on line 2, column 10:
|
|
2
2
|
1 .test {
|
|
3
3
|
2 color: color("NOT A COLOR");
|
|
4
4
|
3 }
|
|
@@ -38,8 +38,11 @@ each(@selectors, {
|
|
|
38
38
|
|
|
39
39
|
@set: {
|
|
40
40
|
one: blue;
|
|
41
|
+
// skip comments
|
|
41
42
|
two: green;
|
|
42
|
-
|
|
43
|
+
/** and these
|
|
44
|
+
*/
|
|
45
|
+
three: red; //and this
|
|
43
46
|
}
|
|
44
47
|
.set {
|
|
45
48
|
each(@set, {
|
|
@@ -73,9 +76,56 @@ each(@selectors, {
|
|
|
73
76
|
});
|
|
74
77
|
}
|
|
75
78
|
|
|
79
|
+
@columns: range(4);
|
|
80
|
+
.column-list {
|
|
81
|
+
list: @columns;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
each(@columns, .(@val) {
|
|
85
|
+
.col-@{val} {
|
|
86
|
+
width: (100% / length(@columns));
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
each(range(10px, 30px, 10px), .(@val, @index) {
|
|
91
|
+
.row-@{index} {
|
|
92
|
+
width: @val;
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
|
|
76
96
|
@list: a b c d;
|
|
77
97
|
.box {
|
|
78
98
|
each(@list, {
|
|
79
99
|
-less-log: extract(@list, @index);
|
|
80
100
|
})
|
|
81
101
|
}
|
|
102
|
+
|
|
103
|
+
// https://github.com/less/less.js/issues/3325
|
|
104
|
+
|
|
105
|
+
@color-schemes: {
|
|
106
|
+
@primary: {
|
|
107
|
+
@color: blue;
|
|
108
|
+
}
|
|
109
|
+
@secondary: {
|
|
110
|
+
@color: red;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
.test {
|
|
114
|
+
each(primary secondary, .(@color-name) {
|
|
115
|
+
@scheme: @color-schemes[@@color-name]; // e.g. @color-name = primary
|
|
116
|
+
color: @scheme[@color];
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@one: {
|
|
121
|
+
@two: {
|
|
122
|
+
foo: red;
|
|
123
|
+
bar: blue;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
each(@one[@two], {
|
|
128
|
+
.@{key} {
|
|
129
|
+
content: @value;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#imported-file {
|
|
2
|
+
background-image: url("./relative/path");
|
|
3
|
+
background-image: url("../relative/path");
|
|
4
|
+
background-image: url("../../relative/path");
|
|
5
|
+
background-image: url("module");
|
|
6
|
+
background-image: url("module/path");
|
|
7
|
+
background-image: url("module/path/../relative/path");
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@import "./folder/file.less";
|
|
2
|
+
|
|
3
|
+
#rewrite-urls-all {
|
|
4
|
+
background-image: url("./relative/path");
|
|
5
|
+
background-image: url("../relative/path");
|
|
6
|
+
background-image: url("./relative/../path");
|
|
7
|
+
background-image: url("./relative/../path/..");
|
|
8
|
+
background-image: url("module");
|
|
9
|
+
background-image: url("module/path");
|
|
10
|
+
background-image: url("module/path/../relative/path");
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#imported-file {
|
|
2
|
+
background-image: url("./relative/path");
|
|
3
|
+
background-image: url("../relative/path");
|
|
4
|
+
background-image: url("../../relative/path");
|
|
5
|
+
background-image: url("module");
|
|
6
|
+
background-image: url("module/path");
|
|
7
|
+
background-image: url("module/path/../relative/path");
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@import "./folder/file.less";
|
|
2
|
+
|
|
3
|
+
#rewrite-urls-local {
|
|
4
|
+
background-image: url("./relative/path");
|
|
5
|
+
background-image: url("../relative/path");
|
|
6
|
+
background-image: url("./relative/../path");
|
|
7
|
+
background-image: url("./relative/../path/..");
|
|
8
|
+
background-image: url("module");
|
|
9
|
+
background-image: url("module/path");
|
|
10
|
+
background-image: url("module/path/../relative/path");
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#imported-file {
|
|
2
|
+
background-image: url("./relative/path");
|
|
3
|
+
background-image: url("../relative/path");
|
|
4
|
+
background-image: url("../../relative/path");
|
|
5
|
+
background-image: url("module");
|
|
6
|
+
background-image: url("module/path");
|
|
7
|
+
background-image: url("module/path/../relative/path");
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@import "./folder/file.less";
|
|
2
|
+
|
|
3
|
+
#rootpath-rewrite-urls-all {
|
|
4
|
+
background-image: url("./relative/path");
|
|
5
|
+
background-image: url("../relative/path");
|
|
6
|
+
background-image: url("./relative/../path");
|
|
7
|
+
background-image: url("./relative/../path/..");
|
|
8
|
+
background-image: url("module");
|
|
9
|
+
background-image: url("module/path");
|
|
10
|
+
background-image: url("module/path/../relative/path");
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#imported-file {
|
|
2
|
+
background-image: url("./relative/path");
|
|
3
|
+
background-image: url("../relative/path");
|
|
4
|
+
background-image: url("../../relative/path");
|
|
5
|
+
background-image: url("module");
|
|
6
|
+
background-image: url("module/path");
|
|
7
|
+
background-image: url("module/path/../relative/path");
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@import "./folder/file.less";
|
|
2
|
+
|
|
3
|
+
#rootpath-rewrite-urls-local {
|
|
4
|
+
background-image: url("./relative/path");
|
|
5
|
+
background-image: url("../relative/path");
|
|
6
|
+
background-image: url("./relative/../path");
|
|
7
|
+
background-image: url("./relative/../path/..");
|
|
8
|
+
background-image: url("module");
|
|
9
|
+
background-image: url("module/path");
|
|
10
|
+
background-image: url("module/path/../relative/path");
|
|
11
|
+
}
|
|
@@ -96,3 +96,21 @@
|
|
|
96
96
|
color: red(rgb(100%, 0, 0));
|
|
97
97
|
border-color: rgba(100%, 0, 0, 50%);
|
|
98
98
|
}
|
|
99
|
+
|
|
100
|
+
#rrggbbaa {
|
|
101
|
+
test-1: #55FF5599;
|
|
102
|
+
test-2: #5F59;
|
|
103
|
+
test-3: lighten(#55FF5599, 10%);
|
|
104
|
+
test-4: fade(#5F59, 10%);
|
|
105
|
+
test-5: rgba(#55FF5599);
|
|
106
|
+
test-6: rgba(#5F59);
|
|
107
|
+
test-7: rgba(#5F59, 0.5);
|
|
108
|
+
test-8: rgba(var(--color-accent), 0.2);
|
|
109
|
+
test-9: rgb(var(--color-accent));
|
|
110
|
+
test-9: hsla(var(--color-accent));
|
|
111
|
+
test-10: color('#55FF5599');
|
|
112
|
+
test-11: hsla(#5F59);
|
|
113
|
+
test-12: hsla(#5F59, 0.5);
|
|
114
|
+
--semi-transparent-dark-background: #001e00ee;
|
|
115
|
+
--semi-transparent-dark-background-2: rgba(0, 30, 0, 238); // invalid opacity will be capped
|
|
116
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
ArgumentError: error evaluating function `color`: argument must be a color keyword or 3
|
|
1
|
+
ArgumentError: error evaluating function `color`: argument must be a color keyword or 3|4|6|8 digit hex e.g. #FFF in {path}color-func-invalid-color.less on line 2, column 10:
|
|
2
2
|
1 .test {
|
|
3
3
|
2 color: color("NOT A COLOR");
|
|
4
4
|
3 }
|
|
@@ -38,8 +38,11 @@ each(@selectors, {
|
|
|
38
38
|
|
|
39
39
|
@set: {
|
|
40
40
|
one: blue;
|
|
41
|
+
// skip comments
|
|
41
42
|
two: green;
|
|
42
|
-
|
|
43
|
+
/** and these
|
|
44
|
+
*/
|
|
45
|
+
three: red; //and this
|
|
43
46
|
}
|
|
44
47
|
.set {
|
|
45
48
|
each(@set, {
|
|
@@ -73,9 +76,56 @@ each(@selectors, {
|
|
|
73
76
|
});
|
|
74
77
|
}
|
|
75
78
|
|
|
79
|
+
@columns: range(4);
|
|
80
|
+
.column-list {
|
|
81
|
+
list: @columns;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
each(@columns, .(@val) {
|
|
85
|
+
.col-@{val} {
|
|
86
|
+
width: (100% / length(@columns));
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
each(range(10px, 30px, 10px), .(@val, @index) {
|
|
91
|
+
.row-@{index} {
|
|
92
|
+
width: @val;
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
|
|
76
96
|
@list: a b c d;
|
|
77
97
|
.box {
|
|
78
98
|
each(@list, {
|
|
79
99
|
-less-log: extract(@list, @index);
|
|
80
100
|
})
|
|
81
101
|
}
|
|
102
|
+
|
|
103
|
+
// https://github.com/less/less.js/issues/3325
|
|
104
|
+
|
|
105
|
+
@color-schemes: {
|
|
106
|
+
@primary: {
|
|
107
|
+
@color: blue;
|
|
108
|
+
}
|
|
109
|
+
@secondary: {
|
|
110
|
+
@color: red;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
.test {
|
|
114
|
+
each(primary secondary, .(@color-name) {
|
|
115
|
+
@scheme: @color-schemes[@@color-name]; // e.g. @color-name = primary
|
|
116
|
+
color: @scheme[@color];
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@one: {
|
|
121
|
+
@two: {
|
|
122
|
+
foo: red;
|
|
123
|
+
bar: blue;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
each(@one[@two], {
|
|
128
|
+
.@{key} {
|
|
129
|
+
content: @value;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#imported-file {
|
|
2
|
+
background-image: url("./relative/path");
|
|
3
|
+
background-image: url("../relative/path");
|
|
4
|
+
background-image: url("../../relative/path");
|
|
5
|
+
background-image: url("module");
|
|
6
|
+
background-image: url("module/path");
|
|
7
|
+
background-image: url("module/path/../relative/path");
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@import "./folder/file.less";
|
|
2
|
+
|
|
3
|
+
#rewrite-urls-all {
|
|
4
|
+
background-image: url("./relative/path");
|
|
5
|
+
background-image: url("../relative/path");
|
|
6
|
+
background-image: url("./relative/../path");
|
|
7
|
+
background-image: url("./relative/../path/..");
|
|
8
|
+
background-image: url("module");
|
|
9
|
+
background-image: url("module/path");
|
|
10
|
+
background-image: url("module/path/../relative/path");
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#imported-file {
|
|
2
|
+
background-image: url("./relative/path");
|
|
3
|
+
background-image: url("../relative/path");
|
|
4
|
+
background-image: url("../../relative/path");
|
|
5
|
+
background-image: url("module");
|
|
6
|
+
background-image: url("module/path");
|
|
7
|
+
background-image: url("module/path/../relative/path");
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@import "./folder/file.less";
|
|
2
|
+
|
|
3
|
+
#rewrite-urls-local {
|
|
4
|
+
background-image: url("./relative/path");
|
|
5
|
+
background-image: url("../relative/path");
|
|
6
|
+
background-image: url("./relative/../path");
|
|
7
|
+
background-image: url("./relative/../path/..");
|
|
8
|
+
background-image: url("module");
|
|
9
|
+
background-image: url("module/path");
|
|
10
|
+
background-image: url("module/path/../relative/path");
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#imported-file {
|
|
2
|
+
background-image: url("./relative/path");
|
|
3
|
+
background-image: url("../relative/path");
|
|
4
|
+
background-image: url("../../relative/path");
|
|
5
|
+
background-image: url("module");
|
|
6
|
+
background-image: url("module/path");
|
|
7
|
+
background-image: url("module/path/../relative/path");
|
|
8
|
+
}
|