-
Notifications
You must be signed in to change notification settings - Fork 3.4k
/
merge.less
81 lines (77 loc) · 1.54 KB
/
merge.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
.first-transform() {
transform+: rotate(90deg), skew(30deg);
}
.second-transform() {
transform+: scale(2,4);
}
.third-transform() {
transform: scaleX(45deg);
}
.fourth-transform() {
transform+: scaleX(45deg);
}
.fifth-transform() {
transform+: scale(2,4) !important;
}
.first-background() {
background+: url(data://img1.png);
}
.second-background() {
background+: url(data://img2.png);
}
.test-rule1 {
// Can merge values
.first-transform();
.second-transform();
}
.test-rule2 {
// Won't merge values without +: merge directive, for backwards compatibility with css
.first-transform();
.third-transform();
}
.test-rule3 {
// Won't merge values from two sources with different properties
.fourth-transform();
.first-background();
}
.test-rule4 {
.first-transform();
.fifth-transform();
}
.test-rule5 {
.first-transform();
.second-transform() !important;
}
.test-rule6 {
.second-transform();
}
.test-rule7 {
// inherit !important from merged subrules
.second-transform();
.second-transform() !important;
.second-transform();
}
.test-rule-interleaved {
transform+: t1;
background+: b1;
transform+: t2;
background+: b2, b3;
transform+: t3;
}
.test-rule-spaced {
transform+_: t1;
background+_: b1;
transform+_: t2;
background+_: b2, b3;
transform+_: t3;
}
.test-rule-interleaved-with-spaced {
transform+_: t1s;
transform+: t2;
background+: b1;
transform+_: t3s;
transform+: t4 t5s;
background+_: b2s, b3;
transform+_: t6s;
background+: b4;
}