Fork me on GitHub

基于sass的样式工具

scss 实用工具样式,开箱即用。

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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172

$color-primary: #F56C6C;
$color-danger: #409EFF;
$color-info: #909399;
$color-success: #67C23A;
$color-warning: #E6A23C;


.f-l{
float:left !important;
_display: inline;
}

.f-r{
float:right !important;
_display: inline;
}


.clearfix {
&:after {
display: block;
overflow: hidden;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
}

.text-r{
text-align: right;
}

.text-l{
text-align: left;
}

.text-c{
text-align: center;
}

// 单行溢出省略号...
.text-overflow-1{
display: block !important;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap
}


// 多行溢出省略号...
.text-overflow-2{
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}


.block-center{
margin: 0 auto;
}


.boxsizing-border{
box-sizing: border-box;
}

//弹性布局
.flex{
display: -webkit-flex;
display: flex;
flex-wrap: wrap; //单行放不下时换行
align-items: flex-start; //交叉轴从轴开始的位置开始排列
}

//主轴对齐方式-居中对齐
.justify-c{
justify-content: center;
}

.justify-start{
justify-content: flex-start;
}



// margin-* padding-* 的快捷类使用 0---45px
$total: 45;
@while $total >= 0 {

.mt-#{$total}{
margin-top: #{$total}px;
}

.mr-#{$total}{
margin-right: #{$total}px;
}

.mb-#{$total}{
margin-bottom: #{$total}px;
}

.ml-#{$total}{
margin-left: #{$total}px;
}

.pt-#{$total}{
padding-top: #{$total}px;
}

.pr-#{$total}{
padding-right: #{$total}px;
}

.pb-#{$total}{
padding-bottom: #{$total}px;
}

.pl-#{$total}{
padding-left: #{$total}px;
}

$total: $total - 1;
}

// 字体颜色
.fc-primary {
color: $color-primary;
}

.fc-danger {
color: $color-danger;
}

//字体大小
$total-f: 30;
@while $total-f >= 8 {
.f-#{$total-f}{
font-size: #{$total-f}px;
}

$total-f: $total-f - 2;
}


// label
.h-label{
display: inline-block;
float: right;
padding-right: 15px;
line-height: 34px;
color: #4A4A4A;
font-weight: normal;

&.h-star::before{
content: "*";
color: #F56C6C;
display: inline;
margin-right: 4px;
}
}

.h-text{
display: inline-block;
float: left;
line-height: 34px;
color: #4A4A4A;
font-weight: normal;
}
0%