-
Notifications
You must be signed in to change notification settings - Fork 47
/
mixins-guards-default-errors.less
57 lines (49 loc) · 1.6 KB
/
mixins-guards-default-errors.less
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
single-default {
.m(@x) when (default()) {property: 1;}
.m(@x) when (default()) and (@x = 1) {property: 3;}
.m(2); //shoud NOT produce error
}
not-default-default {
.m(@x) when (default()) {property: 1;}
.m(@x) when not(default()) {property: 3;}
.m(2); //SHOULD produce error explained-in-less.js#1800
}
multiple-default {
.m(@x) when (default()) {property: 1;}
.m(@x) when (default()) {property: 2;}
.m(@x) when (default()) and (@x = 1) {property: 3;}
.m(1); //shoud produce error
.m(2); //shoud produce error
}
multiple-default-and-other-things {
.m(@x) {property: no guard;}
.m(1) when not(default()) {property: pattern;}
.m(@x) when not(default()) {property: not-default;}
.m(@x) when (default()) {property: 1;}
.m(@x) when (default()) {property: 2;}
.m(@x) when (default()) and (@x = 1) {property: 3;}
.m(1); //shoud NOT produce error
.m(2); //shoud NOT produce error
}
only-one-not-default {
.m(@x) when not(default()) {not-default-2: @x}
.m(2);
}
multiple-not-default {
.m(@x) when not(default()) {not-default-1: @x}
.m(@x) when not(default()) {not-default-2: @x}
.m(2);
}
multiple-not-default-and-other-things-1 {
.m(@x) {property: no guard;}
.m(@x) when not(default()) {not-default-1: @x}
.m(@x) when not(default()) {not-default-2: @x}
.m(2); //shoud NOT produce error
}
multiple-not-default-and-other-things-2 {
.m(@x) when (default()) and (@x = 1) {property: 3;}
.m(@x) when not(default()) {not-default-1: @x}
.m(@x) when not(default()) {not-default-2: @x}
.m(1); //SHOULD produce error
.m(2); //SHOULD produce error
}