6
jinlin
2023-11-30 499dfffcf6e41f558e80f57e16860e6fb2bdcb31
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// 定义颜色
@themeColor: #05192E;
@text: #333;
@description: #999;
@title: #666;
@buttonColor: #4DA0FE;
@buttonHover: #418DDF;
@backgroundColor: #011230;
@borderColor: #e5e5e5;
@white: transparent;
@header: #F0F7FF;
@divback:rgba(255,255,255,0.3);
//定义字体
@normalSize: 14px;
@formSize: 12px;
@titleSize: 16px;
@projectNameSize: 18px;
//zIndex
@z1: 1;
@z2: 2;
@z3: 3;
@z4: 4;
@z5: 5;
 
.border(@size: 1px) {
  border: @size solid @borderColor;
}
 
//圆角
.borderRadius(@radius) {
  -webkit-border-radius: @radius;
  -moz-border-radius: @radius;
  -ms-border-radius: @radius;
  -o-border-radius: @radius;
  border-radius: @radius;
}
 
//阴影效果
.shadow (@x:1px,@y:1px,@blurry:1px,@color:#F4F4F4) {
  -moz-box-shadow: @x @y @blurry @color;
  -webkit-box-shadow: @x @y @blurry @color;
  box-shadow: @x @y @blurry @color;
}
 
//定位全屏
.allCover(@top) {
  position: absolute;
  top: @top;
  left: 0;
  right: 0;
  bottom: 0;
}
 
//定位上下左右居中
.center() {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
}
 
//定位上下居中
.ct() {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
 
//定位上下居中
.cl() {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
 
//设置宽高
.wh(@width, @height) {
  width: @width;
  height: @height;
}
 
//字体大小、行高、字体
.font(@size,@line-height, @family: 'SimSun,Arial Narrow,HELVETICA;') {
  font: @size/@line-height @family;
}
 
//字体大小,颜色
.sc(@size, @color) {
  font-size: @size;
  color: @color;
}
 
//flex 布局和 子元素 对其方式
.fj(@type: space-between) {
  display: flex;
  justify-content: @type;
}
 
//背景渐变
 
.bgGradient(@to,@form) {
  background: @to;
  background: -moz-linear-gradient(top, @to 0%, @form 100%);
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, @to), color-stop(100%, @form));
  background: -webkit-linear-gradient(top, @to 0%, @form 100%);
  background: -o-linear-gradient(top, @to 0%, @form 100%);
  background: -ms-linear-gradient(top, @to 0%, @form 100%);
  background: linear-gradient(to bottom, @to 0%, @form 100%);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='@{to}', endColorstr='@{form}', GradientType=0);
}
 
.default-btn {
  .borderRadius(5px);
  .bgGradient(#eeeeee, #dddddd);
  &:hover {
    .bgGradient(#dddddd, #eeeeee);
  }
}
 
.success-btn {
  .borderRadius(5px);
  .bgGradient(@buttonColor, #3F82D1);
  &:hover {
    .bgGradient(@buttonColor, @buttonHover);
  }
}
 
.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}