icon.less
1.21 KB
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
@import "sprite";
//retina @2x
.sprite-width(@sprite) {
width: extract(@sprite, 5)/2;
}
.sprite-height(@sprite) {
height: extract(@sprite, 6)/2;
}
.sprite-position(@sprite) {
@sprite-offset-x: extract(@sprite, 3)/2;
@sprite-offset-y: extract(@sprite, 4)/2;
background-position: @sprite-offset-x @sprite-offset-y;
}
.sprite-background-size(@spritesheet-width) {
background-size: @spritesheet-width/2;
}
.sprite-image(@sprite) {
@sprite-image: extract(@sprite, 9);
@sprite-image-bare: ~`"@{sprite-image}".slice(1, -1)`;
background-image: url(@sprite-image-bare);
}
.sprite(@sprite) {
.sprite-image(@sprite);
.sprite-position(@sprite);
.sprite-width(@sprite);
.sprite-height(@sprite);
.sprite-background-size(@spritesheet-width);
}
//合并图
.m-icon{
display: inline-block;
vertical-align: middle;
}
.sprites(@spritesheet-sprites);
//自定义 非合并图
//首页状态 icon
.icon-cert{
.icon-state_yanzheng;
}
.icon-certing{
.icon-state_zhong;
}
.icon-certinvalid{
.icon-state_wei;
}
.icon-amount{
.icon-state_bao;
}
.icon-lock{
.icon-state_suo;
}
.icon-road{
.icon-state_xianlu;
}
.icon-state_zhaohuo {
background: url(../images/s.gif) no-repeat 0 0;
background-size: 150px 150px;
}