-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuni.scss
61 lines (61 loc) · 1.46 KB
/
uni.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
@use "sass:math";
/* 初始化所有元素 */
@mixin initEveryStyle{
padding: 0px;
margin: 0px;
border: 0px;
box-sizing: border-box;
}
/* 固定宽度 */
@mixin fixedWidth($size) {
min-width: $size;
max-width: $size;
}
/* 固定高度 */
@mixin fixedHeight($size) {
min-height: $size;
max-height: $size;
}
/* 固定长方形 */
@mixin fixedRetangle($widthSize, $heightSize){
@include fixedWidth($widthSize);
@include fixedHeight($heightSize);
box-sizing: border-box;
}
/* 固定正方形 */
@mixin fixedSquare($size){
@include fixedRetangle($size, $size);
}
/* 固定圆角矩形 */
@mixin fixedRoundedRectangle($widthSize, $heightSize, $borderRadiusSize){
@include fixedRetangle($widthSize, $heightSize);
border-radius: $borderRadiusSize;
}
/*固定胶囊形*/
@mixin fixedCapsule($widthSize, $heightSize){
@include fixedRetangle($widthSize, $heightSize);
border-radius: math.div($heightSize,2);
}
/* 固定圆形 */
@mixin fixedCircle($size){
@include fixedRoundedRectangle($size,$size,50%);
}
/* 固定圆形图片 */
@mixin fixedCircleImg($size, $imgSrc) {
@include fixedCircle($size);
background-image: url(#{$imgSrc});
background-size: 100%;
background-position: center;
}
/* 固定充满父容器 */
@mixin fullInParent {
@include fixedSquare(100%);
}
/* 固定充满父容器的图片 */
@mixin imgFullInParent($imgSrc) {
@include fullInParent;
background-image: url(#{$imgSrc});
background-repeat: no-repeat;
background-position: center;
background-size: 100%;
}