less 3.6.0 → 3.8.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/CHANGELOG.md +13 -0
- package/Gruntfile.js +43 -6
- package/bin/lessc +32 -3
- package/dist/less.js +2810 -326
- package/dist/less.min.js +7 -7
- package/lib/less/constants.js +13 -0
- package/lib/less/contexts.js +45 -10
- package/lib/less/default-options.js +12 -4
- package/lib/less/functions/color.js +84 -41
- package/lib/less/functions/data-uri.js +1 -1
- package/lib/less/functions/index.js +1 -0
- package/lib/less/functions/list.js +101 -0
- package/lib/less/functions/types.js +1 -19
- package/lib/less/import-manager.js +3 -3
- package/lib/less/index.js +1 -1
- package/lib/less/parse.js +3 -3
- package/lib/less/parser/parser.js +31 -13
- package/lib/less/render.js +2 -2
- package/lib/less/source-map-output.js +2 -2
- package/lib/less/tree/color.js +58 -18
- package/lib/less/tree/declaration.js +11 -7
- package/lib/less/tree/expression.js +7 -3
- package/lib/less/tree/import.js +9 -8
- package/lib/less/tree/mixin-definition.js +1 -1
- package/lib/less/tree/operation.js +10 -4
- package/lib/less/tree/url.js +12 -8
- package/lib/less/utils.js +54 -19
- package/lib/less-browser/add-default-options.js +3 -3
- package/lib/less-browser/index.js +9 -2
- package/lib/less-node/image-size.js +1 -1
- package/lib/less-node/lessc-helper.js +12 -4
- package/package.json +5 -2
- 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 +2810 -326
- package/test/browser/runner-browser-options.js +1 -1
- package/test/browser/runner-errors-options.js +1 -1
- package/test/browser/runner-legacy-options.js +1 -1
- 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/calc.css +2 -2
- package/test/css/colors.css +20 -3
- package/test/css/css-3.css +0 -8
- package/test/css/css-escapes.css +3 -0
- package/test/css/functions-each.css +48 -0
- package/test/css/functions.css +6 -4
- package/test/css/math/parens-division/media-math.css +10 -0
- package/test/css/math/parens-division/mixins-args.css +169 -0
- package/test/css/math/parens-division/new-division.css +16 -0
- package/test/css/math/parens-division/parens.css +37 -0
- package/test/css/math/strict/css.css +95 -0
- package/test/css/math/strict/media-math.css +10 -0
- package/test/css/math/strict/mixins-args.css +169 -0
- package/test/css/math/strict/parens.css +37 -0
- package/test/css/{strict-math → math/strict-legacy}/css.css +0 -0
- package/test/css/math/strict-legacy/media-math.css +10 -0
- package/test/css/{strict-math → math/strict-legacy}/mixins-args.css +0 -0
- package/test/css/{strict-math → math/strict-legacy}/parens.css +5 -1
- package/test/css/no-strict-math/no-sm-operations.css +3 -0
- 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 +28 -15
- package/test/less/colors.less +18 -0
- package/test/less/css-3.less +0 -9
- package/test/less/css-escapes.less +4 -0
- package/test/less/errors/color-func-invalid-color.txt +1 -1
- package/test/less/errors/mixin-not-defined-2.less +7 -0
- package/test/less/errors/mixin-not-defined-2.txt +4 -0
- package/test/less/functions-each.less +81 -0
- package/test/less/functions.less +14 -2
- package/test/less/math/parens-division/media-math.less +9 -0
- package/test/less/math/parens-division/mixins-args.less +264 -0
- package/test/less/math/parens-division/new-division.less +17 -0
- package/test/less/{strict-math → math/parens-division}/parens.less +2 -1
- package/test/less/math/strict/css.less +108 -0
- package/test/less/math/strict/media-math.less +9 -0
- package/test/less/math/strict/mixins-args.less +264 -0
- package/test/less/math/strict/parens.less +46 -0
- package/test/less/{strict-math → math/strict-legacy}/css.less +0 -0
- package/test/less/math/strict-legacy/media-math.less +9 -0
- package/test/less/{strict-math → math/strict-legacy}/mixins-args.less +0 -0
- package/test/less/math/strict-legacy/parens.less +50 -0
- package/test/less/no-strict-math/no-sm-operations.less +3 -0
- 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-3.less +0 -9
- 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/errors/mixin-not-defined-2.less +7 -0
- package/test/less-bom/errors/mixin-not-defined-2.txt +4 -0
- package/test/less-bom/functions-each.less +81 -0
- package/test/less-bom/functions.less +14 -2
- package/test/less-bom/math/parens-division/media-math.less +9 -0
- package/test/less-bom/math/parens-division/mixins-args.less +264 -0
- package/test/less-bom/math/parens-division/new-division.less +17 -0
- package/test/less-bom/{strict-math → math/parens-division}/parens.less +2 -1
- package/test/less-bom/math/strict/css.less +108 -0
- package/test/less-bom/math/strict/media-math.less +9 -0
- package/test/less-bom/math/strict/mixins-args.less +264 -0
- package/test/less-bom/math/strict/parens.less +46 -0
- package/test/less-bom/{strict-math → math/strict-legacy}/css.less +0 -0
- package/test/less-bom/math/strict-legacy/media-math.less +9 -0
- package/test/less-bom/{strict-math → math/strict-legacy}/mixins-args.less +0 -0
- package/test/less-bom/math/strict-legacy/parens.less +50 -0
- package/test/less-bom/no-strict-math/no-sm-operations.less +3 -0
- 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/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/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
|
File without changes
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
.parens {
|
|
2
|
+
@var: 1px;
|
|
3
|
+
border: (@var * 2) solid black;
|
|
4
|
+
margin: (@var * 1) (@var + 2) (4 * 4) 3;
|
|
5
|
+
width: (6 * 6);
|
|
6
|
+
padding: 2px (6 * 6px);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.in-function {
|
|
10
|
+
value: min((1 + 1)) + 1;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.more-parens {
|
|
14
|
+
@var: (2 * 2);
|
|
15
|
+
padding: (2 * @var) 4 4 (@var * 1px);
|
|
16
|
+
width-all: ((@var * @var) * 6);
|
|
17
|
+
width-first: ((@var * @var)) * 6;
|
|
18
|
+
width-keep: (@var * @var) * 6;
|
|
19
|
+
height: calc(100% + (25vh - 20px));
|
|
20
|
+
height-keep: (7 * 7) + (8 * 8);
|
|
21
|
+
height-all: ((7 * 7) + (8 * 8));
|
|
22
|
+
height-parts: ((7 * 7)) + ((8 * 8));
|
|
23
|
+
margin-keep: (4 * (5 + 5) / 2) - (@var * 2);
|
|
24
|
+
margin-parts: ((4 * (5 + 5) / 2)) - ((@var * 2));
|
|
25
|
+
margin-all: ((4 * (5 + 5) / 2) + (-(@var * 2)));
|
|
26
|
+
border-radius-keep: 4px * (1 + 1) / @var + 3px;
|
|
27
|
+
border-radius-parts: ((4px * (1 + 1))) / ((@var + 3px));
|
|
28
|
+
border-radius-all: (4px * (1 + 1) / @var + 3px);
|
|
29
|
+
// margin: (6 * 6)px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.negative {
|
|
33
|
+
@var: 1;
|
|
34
|
+
neg-var: -@var; // -1 ?
|
|
35
|
+
neg-var-paren: -(@var); // -(1) ?
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.nested-parens {
|
|
39
|
+
width: 2 * (4 * (2 + (1 + 6))) - 1;
|
|
40
|
+
height: ((2 + 3) * (2 + 3) / (9 - 4)) + 1;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.mixed-units {
|
|
44
|
+
margin: 2px 4em 1 5pc;
|
|
45
|
+
padding: (2px + 4px) 1em 2px 2;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.test-false-negatives {
|
|
49
|
+
a: ~"(";
|
|
50
|
+
}
|
|
@@ -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
|
+
}
|
package/test/less-bom/css-3.less
CHANGED
|
@@ -79,15 +79,6 @@ p::before {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
.units {
|
|
83
|
-
font: 1.2rem/2rem;
|
|
84
|
-
font: 8vw/9vw;
|
|
85
|
-
font: 10vh/12vh;
|
|
86
|
-
font: 12vm/15vm;
|
|
87
|
-
font: 12vmin/15vmin;
|
|
88
|
-
font: 1.2ch/1.5ch;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
82
|
@supports ( box-shadow: 2px 2px 2px black ) or
|
|
92
83
|
( -moz-box-shadow: 2px 2px 2px black ) {
|
|
93
84
|
.outline {
|
|
@@ -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 }
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
@selectors: blue, green, red;
|
|
2
|
+
@list: a b c d;
|
|
3
|
+
|
|
4
|
+
each(@selectors, {
|
|
5
|
+
.sel-@{value} {
|
|
6
|
+
a: b;
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
.each {
|
|
11
|
+
each(@list, {
|
|
12
|
+
index+: @index;
|
|
13
|
+
item@{index}: @value;
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
// nested each
|
|
17
|
+
each(10px 15px, 20px 25px; {
|
|
18
|
+
// demonstrates nesting of each()
|
|
19
|
+
each(@value; #(@v, @k, @i) {
|
|
20
|
+
nest-@{i}-@{index}: @v @k;
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// nested anonymous mixin
|
|
25
|
+
.nest-anon {
|
|
26
|
+
each(a b, .(@v;@i) {
|
|
27
|
+
each(c d, .(@vv;@ii) {
|
|
28
|
+
nest-@{i}-@{ii}: @v @vv;
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// vector math
|
|
34
|
+
each(1 2 3 4, {
|
|
35
|
+
padding+_: (@value * 10px);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@set: {
|
|
40
|
+
one: blue;
|
|
41
|
+
two: green;
|
|
42
|
+
three: red;
|
|
43
|
+
}
|
|
44
|
+
.set {
|
|
45
|
+
each(@set, {
|
|
46
|
+
@{key}: @value;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
.set-2() {
|
|
50
|
+
one: blue;
|
|
51
|
+
two: green;
|
|
52
|
+
three: red;
|
|
53
|
+
}
|
|
54
|
+
.set-2 {
|
|
55
|
+
each(.set-2(), .(@v, @k, @i) {
|
|
56
|
+
@{k}-@{i}: @v;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.pick(@a) when (@a = 4) {
|
|
61
|
+
val3: @a;
|
|
62
|
+
}
|
|
63
|
+
.single {
|
|
64
|
+
each(true, {
|
|
65
|
+
val: @value;
|
|
66
|
+
});
|
|
67
|
+
@exp: 1 + 1;
|
|
68
|
+
each(@exp, {
|
|
69
|
+
val2: @value;
|
|
70
|
+
});
|
|
71
|
+
each(1 2 3 4, {
|
|
72
|
+
.pick(@value);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@list: a b c d;
|
|
77
|
+
.box {
|
|
78
|
+
each(@list, {
|
|
79
|
+
-less-log: extract(@list, @index);
|
|
80
|
+
})
|
|
81
|
+
}
|
|
@@ -257,11 +257,23 @@ html {
|
|
|
257
257
|
e: if(not(true), 5);
|
|
258
258
|
@f: boolean(3 = 4);
|
|
259
259
|
f: if(not(@f), 6);
|
|
260
|
-
g: if(
|
|
260
|
+
g: if(true, 3, 5);
|
|
261
261
|
h: if(false, 3, 5);
|
|
262
262
|
i: if(true and isnumber(6), 6, 8);
|
|
263
263
|
j: if(not(true) and true, 6, 8);
|
|
264
264
|
k: if(true or true, 1);
|
|
265
265
|
|
|
266
|
-
if(false, {g: 7}); /* results in void */
|
|
266
|
+
if((false), {g: 7}); /* results in void */
|
|
267
|
+
|
|
268
|
+
@conditional: if((true), {
|
|
269
|
+
color: green;
|
|
270
|
+
}, {});
|
|
271
|
+
@conditional();
|
|
272
|
+
|
|
273
|
+
@falsey: if((false), {
|
|
274
|
+
color: orange;
|
|
275
|
+
}, {
|
|
276
|
+
color: purple;
|
|
277
|
+
});
|
|
278
|
+
@falsey();
|
|
267
279
|
}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
.mixin (@a: 1px, @b: 50%) {
|
|
2
|
+
width: (@a * 5);
|
|
3
|
+
height: (@b - 1%);
|
|
4
|
+
depth: @b - 1%;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.mixina (@style, @width, @color: black) {
|
|
8
|
+
border: @width @style @color;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.mixiny
|
|
12
|
+
(@a: 0, @b: 0) {
|
|
13
|
+
margin: @a;
|
|
14
|
+
padding: @b;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.hidden() {
|
|
18
|
+
color: transparent; // asd
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
#hidden {
|
|
22
|
+
.hidden;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
#hidden1 {
|
|
26
|
+
.hidden();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.two-args {
|
|
30
|
+
color: blue;
|
|
31
|
+
.mixin(2px, 100%);
|
|
32
|
+
.mixina(dotted, 2px);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.one-arg {
|
|
36
|
+
.mixin(3px);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.no-parens {
|
|
40
|
+
.mixin;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.no-args {
|
|
44
|
+
.mixin();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.var-args {
|
|
48
|
+
@var: 9;
|
|
49
|
+
.mixin(@var, (@var * 2) / 2);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.multi-mix {
|
|
53
|
+
.mixin(2px, 30%);
|
|
54
|
+
.mixiny(4, 5);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.maxa(@arg1: 10, @arg2: #f00) {
|
|
58
|
+
padding: (@arg1 * 2px);
|
|
59
|
+
color: @arg2;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
body {
|
|
63
|
+
.maxa(15);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@glob: 5;
|
|
67
|
+
.global-mixin(@a:2) {
|
|
68
|
+
width: (@glob + @a);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.scope-mix {
|
|
72
|
+
.global-mixin(3);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.nested-ruleset (@width: 200px) {
|
|
76
|
+
width: @width;
|
|
77
|
+
.column { margin: @width; }
|
|
78
|
+
}
|
|
79
|
+
.content {
|
|
80
|
+
.nested-ruleset(600px);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
//
|
|
84
|
+
|
|
85
|
+
.same-var-name2(@radius) {
|
|
86
|
+
radius: @radius;
|
|
87
|
+
}
|
|
88
|
+
.same-var-name(@radius) {
|
|
89
|
+
.same-var-name2(@radius);
|
|
90
|
+
}
|
|
91
|
+
#same-var-name {
|
|
92
|
+
.same-var-name(5px);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
//
|
|
96
|
+
|
|
97
|
+
.var-inside () {
|
|
98
|
+
@var: 10px;
|
|
99
|
+
width: @var;
|
|
100
|
+
}
|
|
101
|
+
#var-inside { .var-inside; }
|
|
102
|
+
|
|
103
|
+
.mixin-arguments (@width: 0px, ...) {
|
|
104
|
+
border: @arguments;
|
|
105
|
+
width: @width;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.arguments {
|
|
109
|
+
.mixin-arguments(1px, solid, black);
|
|
110
|
+
}
|
|
111
|
+
.arguments2 {
|
|
112
|
+
.mixin-arguments();
|
|
113
|
+
}
|
|
114
|
+
.arguments3 {
|
|
115
|
+
.mixin-arguments;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.mixin-arguments2 (@width, @rest...) {
|
|
119
|
+
border: @arguments;
|
|
120
|
+
rest: @rest;
|
|
121
|
+
width: @width;
|
|
122
|
+
}
|
|
123
|
+
.arguments4 {
|
|
124
|
+
.mixin-arguments2(0, 1, 2, 3, 4);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Edge cases
|
|
128
|
+
|
|
129
|
+
.edge-case {
|
|
130
|
+
.mixin-arguments("{");
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Division vs. Literal Slash
|
|
134
|
+
.border-radius(@r: 2px/5px) {
|
|
135
|
+
border-radius: @r;
|
|
136
|
+
}
|
|
137
|
+
.slash-vs-math {
|
|
138
|
+
.border-radius();
|
|
139
|
+
.border-radius(5px/10px);
|
|
140
|
+
.border-radius((3px * 2));
|
|
141
|
+
}
|
|
142
|
+
// semi-colon vs comma for delimiting
|
|
143
|
+
|
|
144
|
+
.mixin-takes-one(@a) {
|
|
145
|
+
one: @a;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.mixin-takes-two(@a; @b) {
|
|
149
|
+
one: @a;
|
|
150
|
+
two: @b;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.comma-vs-semi-colon {
|
|
154
|
+
.mixin-takes-two(@a : a; @b : b, c);
|
|
155
|
+
.mixin-takes-two(@a : d, e; @b : f);
|
|
156
|
+
.mixin-takes-one(@a: g);
|
|
157
|
+
.mixin-takes-one(@a : h;);
|
|
158
|
+
.mixin-takes-one(i);
|
|
159
|
+
.mixin-takes-one(j;);
|
|
160
|
+
.mixin-takes-two(k, l);
|
|
161
|
+
.mixin-takes-one(m, n;);
|
|
162
|
+
.mixin-takes-two(o, p; q);
|
|
163
|
+
.mixin-takes-two(r, s; t;);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.mixin-conflict(@a:defA, @b:defB, @c:defC) {
|
|
167
|
+
three: @a, @b, @c;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.mixin-conflict(@a:defA, @b:defB, @c:defC, @d:defD) {
|
|
171
|
+
four: @a, @b, @c, @d;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
#named-conflict {
|
|
175
|
+
.mixin-conflict(11, 12, 13, @a:a);
|
|
176
|
+
.mixin-conflict(@a:a, 21, 22, 23);
|
|
177
|
+
}
|
|
178
|
+
@a: 3px;
|
|
179
|
+
.mixin-default-arg(@a: 1px, @b: @a, @c: @b) {
|
|
180
|
+
defaults: 1px 1px 1px;
|
|
181
|
+
defaults: 2px 2px 2px;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.test-mixin-default-arg {
|
|
185
|
+
.mixin-default-arg();
|
|
186
|
+
.mixin-default-arg(2px);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.mixin-comma-default1(@color; @padding; @margin: 2, 2, 2, 2) {
|
|
190
|
+
margin: @margin;
|
|
191
|
+
}
|
|
192
|
+
.selector {
|
|
193
|
+
.mixin-comma-default1(#33acfe; 4);
|
|
194
|
+
}
|
|
195
|
+
.mixin-comma-default2(@margin: 2, 2, 2, 2;) {
|
|
196
|
+
margin: @margin;
|
|
197
|
+
}
|
|
198
|
+
.selector2 {
|
|
199
|
+
.mixin-comma-default2();
|
|
200
|
+
}
|
|
201
|
+
.mixin-comma-default3(@margin: 2, 2, 2, 2) {
|
|
202
|
+
margin: @margin;
|
|
203
|
+
}
|
|
204
|
+
.selector3 {
|
|
205
|
+
.mixin-comma-default3(4,2,2,2);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.test-calling-one-arg-mixin(@a) {
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.test-calling-one-arg-mixin(@a, @b, @rest...) {
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
div {
|
|
215
|
+
.test-calling-one-arg-mixin(1);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
mixins-args-expand-op- {
|
|
219
|
+
@x: 1, 2, 3;
|
|
220
|
+
@y: 4 5 6;
|
|
221
|
+
|
|
222
|
+
&1 {.m3(@x...)}
|
|
223
|
+
&2 {.m3(@y...)}
|
|
224
|
+
&3 {.wr(a, b, c)}
|
|
225
|
+
&4 {.wr(a; b; c, d)}
|
|
226
|
+
&5 {.wr(@x...)}
|
|
227
|
+
&6 {.m4(0; @x...)}
|
|
228
|
+
&7 {.m4(@x..., @a: 0)}
|
|
229
|
+
&8 {.m4(@b: 1.5; @x...)}
|
|
230
|
+
&9 {.aa(@y, @x..., and again, @y...)}
|
|
231
|
+
|
|
232
|
+
.m3(@a, @b, @c) {
|
|
233
|
+
m3: @a, @b, @c;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.m4(@a, @b, @c, @d) {
|
|
237
|
+
m4: @a, @b, @c, @d;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.wr(@a...) {
|
|
241
|
+
&a {.m3(@a...)}
|
|
242
|
+
&b {.m4(0, @a...)}
|
|
243
|
+
&c {.m4(@a..., 4)}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.aa(@a...) {
|
|
247
|
+
aa: @a;
|
|
248
|
+
a4: extract(@a, 5);
|
|
249
|
+
a8: extract(@a, 8);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
#test-mixin-matching-when-default-2645 {
|
|
253
|
+
.mixin(@height) {
|
|
254
|
+
height: @height;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.mixin(@width, @height: 10px) {
|
|
258
|
+
width: @width;
|
|
259
|
+
|
|
260
|
+
.mixin(@height: @height);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.mixin(@height: 20px);
|
|
264
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.units {
|
|
2
|
+
font: 1.2rem/2rem;
|
|
3
|
+
font: 8vw/9vw;
|
|
4
|
+
font: 10vh/12vh;
|
|
5
|
+
font: 12vm/15vm;
|
|
6
|
+
font: 12vmin/15vmin;
|
|
7
|
+
font: 1.2ch/1.5ch;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.math {
|
|
11
|
+
a: 1 + 1;
|
|
12
|
+
b: 2px / 2;
|
|
13
|
+
c: 2px ./ 2;
|
|
14
|
+
d: (10px / 10px);
|
|
15
|
+
e: ((16px ./ 2) / 2) / 2;
|
|
16
|
+
f: ((16px ./ 2) / 2) ./ 2;
|
|
17
|
+
}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
width-all: ((@var * @var) * 6);
|
|
13
13
|
width-first: ((@var * @var)) * 6;
|
|
14
14
|
width-keep: (@var * @var) * 6;
|
|
15
|
+
height: calc(100% + (25vh - 20px));
|
|
15
16
|
height-keep: (7 * 7) + (8 * 8);
|
|
16
17
|
height-all: ((7 * 7) + (8 * 8));
|
|
17
18
|
height-parts: ((7 * 7)) + ((8 * 8));
|
|
@@ -21,7 +22,7 @@
|
|
|
21
22
|
border-radius-keep: 4px * (1 + 1) / @var + 3px;
|
|
22
23
|
border-radius-parts: ((4px * (1 + 1))) / ((@var + 3px));
|
|
23
24
|
border-radius-all: (4px * (1 + 1) / @var + 3px);
|
|
24
|
-
//margin: (6 * 6)px;
|
|
25
|
+
// margin: (6 * 6)px;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
.negative {
|