-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon-style-less.less
112 lines (105 loc) · 2.01 KB
/
common-style-less.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/*text*/
//ellipsis
.text-ellipsis(@lines: 1) {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: @lines;
-webkit-box-orient: vertical;
}
//size
.font-l {
font-size: 16px;
}
.font-n {
font-size: 14px;
}
.font-s {
font-size: 12px;
}
//weight
.bold {
font-weight: bold;
}
.normal {
font-weight: normal;
}
.lighter {
font-weight: lighter;
}
/*布局*/
//行内元素对齐
.text-c {
text-align: center;
}
.text-l {
text-align: left;
}
.text-r {
text-align: right;
}
//两边对齐弹性布局
.flex-between {
display: flex;
justify-content: space-between;
align-items: center;
}
//间隔相等弹性布局
.flex-around {
display: flex;
justify-content: space-around;
align-items: center;
}
//水平居中
.flex-center {
display: flex;
justify-content: center;
align-items: center;
}
//弹性布局从头排
.flex-start {
display: flex;
justify-content: flex-start;
align-items: center;
}
//弹性布局从尾排
.flex-end {
display: flex;
justify-content: flex-end;
align-items: center;
}
.flex-content(@style:flex-start){
display: flex;
justify-content: @style;
align-items: center;
}
//section尺寸大小
.size(@w:100%, @h:100%) { width: @w; height: @h; }
//滚动条
/*定义滚动条高宽及背景
高宽分别对应横竖滚动条的尺寸*/
.scrollbar(@w:10px,@h:10px,@scrollbarBgColor:white,@thumbBgColor:black,@thumbBgHoverColor:#404040,@thumbRadius:5px){
&::-webkit-scrollbar {
width: @w;
height: @h;
background-color: @scrollbarBgColor;
}
/*定义滚动条轨道
背景颜色*/
&::-webkit-scrollbar-track
{
background-color:@scrollbarBgColor;
}
/* 暗色模式下的滚动条滑块样式 */
&::-webkit-scrollbar-thumb {
background-color: @thumbBgColor;
border-radius: @thumbRadius;
&:hover {
background-color: @thumbBgHoverColor;
}
}
}
//透明度颜色设置
.color-opacity(@color: #000, @opacity: 0.5) {
background-color: rgba(red(@color), green(@color), blue(@color), @opacity);
}