mixins.less
2.15 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
.round-borders (@radius) {
border-radius : @radius;
-moz-border-radius : @radius;
-webkit-border-radius: @radius;
}
.justify-align-center() {
display : flex;
justify-content: center;
align-items : center;
}
.justify-align-between(){
display : flex;
align-items : center;
justify-content: space-between;
}
.justify-between{
display : flex;
justify-content: space-between;
}
.justify-center() {
display : flex;
justify-content: center;
}
.align-center() {
display : flex;
align-items: center;
}
.ellipsis() {
overflow : hidden;
text-overflow: ellipsis;
white-space : nowrap;
}
// 字重
.fw550 {
font-weight: 550;
}
// flex 水平、垂直都居中,默认主轴方向为水平方向
.flex-center(@direction: row) when (@direction =row),
(@direction =h) {
.justify-align-center();
flex-direction: row;
}
// flex 水平、垂直都居中
.flex-center(@direction: row) when(@direction =column),
(@direction =v) {
.justify-align-center();
flex-direction: column;
}
// flex水平居中主轴为水平方向
.flex-center-h(@direction: row) when (@direction =row),
(@direction =h) {
.justify-center();
flex-direction: row;
}
// flex水平居中主轴为垂直方向
.flex-center-h(@direction: row) when (@direction =column),
(@direction =v) {
.align-center();
flex-direction: column;
}
// flex垂直居中主轴为水平方向
.flex-center-v(@direction: row) when (@direction =row),
(@direction =h) {
.align-center();
flex-direction: row;
}
// flex垂直居中主轴为垂直方向
.flex-center-v(@direction: row) when (@direction =column),
(@direction =v) {
.justify-center();
flex-direction: column;
}
// 固定显示多上行,size:固定显示的行数
.line-clamp(@size) {
overflow : hidden;
text-overflow : ellipsis;
line-clamp : @size;
-webkit-line-clamp: @size;
display : -webkit-box;
-webkit-box-orient: vertical;
}
// 旋转角度
.transform-rotate(@deg) {
transform : rotate(@deg);
-ms-transform : rotate(@deg);
-moz-transform : rotate(@deg);
-webkit-transform: rotate(@deg);
-o-transform : rotate(@deg);
}