-
Notifications
You must be signed in to change notification settings - Fork 0
/
builds.scss
66 lines (65 loc) · 1.27 KB
/
builds.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
// 构建颜色辅助类
@mixin build-colors($name, $color) {
// 生成颜色类 color-primary ...
.color-#{$name} {
color: $color !important;
}
// 生成背景颜色类
.bgc-#{$name} {
background-color: $color !important;
}
// 生成边框颜色类 .bdc-primary ...
.bdc-#{$name} {
border-color: $color !important;
}
}
// 生成字体大小类 .fz-14 ...
@mixin build-font-sizes($begin, $end) {
@for $i from $begin through $end {
.font-#{$i} {
font-size: #{$i}px !important;
}
.fz-#{$i} {
font-size: #{$i}px;
}
}
}
@mixin build-spaces($space) {
.mt-#{$space} {
margin-top: #{$space}px;
}
.pt-#{$space} {
padding-top: #{$space}px;
}
.mb-#{$space} {
margin-bottom: #{$space}px;
}
.pb-#{$space} {
padding-bottom: #{$space}px;
}
.ml-#{$space} {
margin-left: #{$space}px;
}
.pl-#{$space} {
padding-left: #{$space}px;
}
.mr-#{$space} {
margin-right: #{$space}px;
}
.pr-#{$space} {
padding-right: #{$space}px;
}
.margin-#{$space} {
margin: #{$space}px;
}
.padding-#{$space} {
padding: #{$space}px;
}
}
// 批量生成
@mixin batch-build-spaces($count) {
@for $i from 1 through $count {
@include build-spaces($i * 4);
@include build-spaces($i * 5);
}
}