sprite_admin.less
8.04 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
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
/*
LESS variables are information about icon's compiled state, stored under its original file name
.icon-home {
width: @icon-home-width;
}
The large array-like variables contain all information about a single icon
@icon-home: x y offset_x offset_y width height total_width total_height image_path name;
At the bottom of this section, we provide information about the spritesheet itself
@spritesheet: width height image @spritesheet-sprites;
*/
@icon-admin-10-name: 'icon-admin_10';
@icon-admin-10-x: 107px;
@icon-admin-10-y: 0px;
@icon-admin-10-offset-x: -107px;
@icon-admin-10-offset-y: 0px;
@icon-admin-10-width: 100px;
@icon-admin-10-height: 56px;
@icon-admin-10-total-width: 313px;
@icon-admin-10-total-height: 206px;
@icon-admin-10-image: '../images/dist/admin_sprite.png';
@icon-admin-10: 107px 0px -107px 0px 100px 56px 313px 206px '../images/dist/admin_sprite.png' 'icon-admin_10';
@icon-admin-11-name: 'icon-admin_11';
@icon-admin-11-x: 213px;
@icon-admin-11-y: 0px;
@icon-admin-11-offset-x: -213px;
@icon-admin-11-offset-y: 0px;
@icon-admin-11-width: 100px;
@icon-admin-11-height: 56px;
@icon-admin-11-total-width: 313px;
@icon-admin-11-total-height: 206px;
@icon-admin-11-image: '../images/dist/admin_sprite.png';
@icon-admin-11: 213px 0px -213px 0px 100px 56px 313px 206px '../images/dist/admin_sprite.png' 'icon-admin_11';
@icon-admin-12-name: 'icon-admin_12';
@icon-admin-12-x: 0px;
@icon-admin-12-y: 62px;
@icon-admin-12-offset-x: 0px;
@icon-admin-12-offset-y: -62px;
@icon-admin-12-width: 100px;
@icon-admin-12-height: 56px;
@icon-admin-12-total-width: 313px;
@icon-admin-12-total-height: 206px;
@icon-admin-12-image: '../images/dist/admin_sprite.png';
@icon-admin-12: 0px 62px 0px -62px 100px 56px 313px 206px '../images/dist/admin_sprite.png' 'icon-admin_12';
@icon-admin-13-name: 'icon-admin_13';
@icon-admin-13-x: 106px;
@icon-admin-13-y: 62px;
@icon-admin-13-offset-x: -106px;
@icon-admin-13-offset-y: -62px;
@icon-admin-13-width: 100px;
@icon-admin-13-height: 56px;
@icon-admin-13-total-width: 313px;
@icon-admin-13-total-height: 206px;
@icon-admin-13-image: '../images/dist/admin_sprite.png';
@icon-admin-13: 106px 62px -106px -62px 100px 56px 313px 206px '../images/dist/admin_sprite.png' 'icon-admin_13';
@icon-admin-14-name: 'icon-admin_14';
@icon-admin-14-x: 0px;
@icon-admin-14-y: 124px;
@icon-admin-14-offset-x: 0px;
@icon-admin-14-offset-y: -124px;
@icon-admin-14-width: 100px;
@icon-admin-14-height: 56px;
@icon-admin-14-total-width: 313px;
@icon-admin-14-total-height: 206px;
@icon-admin-14-image: '../images/dist/admin_sprite.png';
@icon-admin-14: 0px 124px 0px -124px 100px 56px 313px 206px '../images/dist/admin_sprite.png' 'icon-admin_14';
@icon-admin-15-name: 'icon-admin_15';
@icon-admin-15-x: 106px;
@icon-admin-15-y: 124px;
@icon-admin-15-offset-x: -106px;
@icon-admin-15-offset-y: -124px;
@icon-admin-15-width: 100px;
@icon-admin-15-height: 56px;
@icon-admin-15-total-width: 313px;
@icon-admin-15-total-height: 206px;
@icon-admin-15-image: '../images/dist/admin_sprite.png';
@icon-admin-15: 106px 124px -106px -124px 100px 56px 313px 206px '../images/dist/admin_sprite.png' 'icon-admin_15';
@icon-admin-2-name: 'icon-admin_2';
@icon-admin-2-x: 0px;
@icon-admin-2-y: 0px;
@icon-admin-2-offset-x: 0px;
@icon-admin-2-offset-y: 0px;
@icon-admin-2-width: 101px;
@icon-admin-2-height: 56px;
@icon-admin-2-total-width: 313px;
@icon-admin-2-total-height: 206px;
@icon-admin-2-image: '../images/dist/admin_sprite.png';
@icon-admin-2: 0px 0px 0px 0px 101px 56px 313px 206px '../images/dist/admin_sprite.png' 'icon-admin_2';
@icon-admin-3-name: 'icon-admin_3';
@icon-admin-3-x: 0px;
@icon-admin-3-y: 186px;
@icon-admin-3-offset-x: 0px;
@icon-admin-3-offset-y: -186px;
@icon-admin-3-width: 16px;
@icon-admin-3-height: 20px;
@icon-admin-3-total-width: 313px;
@icon-admin-3-total-height: 206px;
@icon-admin-3-image: '../images/dist/admin_sprite.png';
@icon-admin-3: 0px 186px 0px -186px 16px 20px 313px 206px '../images/dist/admin_sprite.png' 'icon-admin_3';
@icon-admin-4-name: 'icon-admin_4';
@icon-admin-4-x: 22px;
@icon-admin-4-y: 186px;
@icon-admin-4-offset-x: -22px;
@icon-admin-4-offset-y: -186px;
@icon-admin-4-width: 16px;
@icon-admin-4-height: 20px;
@icon-admin-4-total-width: 313px;
@icon-admin-4-total-height: 206px;
@icon-admin-4-image: '../images/dist/admin_sprite.png';
@icon-admin-4: 22px 186px -22px -186px 16px 20px 313px 206px '../images/dist/admin_sprite.png' 'icon-admin_4';
@icon-admin-5-name: 'icon-admin_5';
@icon-admin-5-x: 58px;
@icon-admin-5-y: 186px;
@icon-admin-5-offset-x: -58px;
@icon-admin-5-offset-y: -186px;
@icon-admin-5-width: 8px;
@icon-admin-5-height: 8px;
@icon-admin-5-total-width: 313px;
@icon-admin-5-total-height: 206px;
@icon-admin-5-image: '../images/dist/admin_sprite.png';
@icon-admin-5: 58px 186px -58px -186px 8px 8px 313px 206px '../images/dist/admin_sprite.png' 'icon-admin_5';
@icon-admin-6-name: 'icon-admin_6';
@icon-admin-6-x: 44px;
@icon-admin-6-y: 186px;
@icon-admin-6-offset-x: -44px;
@icon-admin-6-offset-y: -186px;
@icon-admin-6-width: 8px;
@icon-admin-6-height: 8px;
@icon-admin-6-total-width: 313px;
@icon-admin-6-total-height: 206px;
@icon-admin-6-image: '../images/dist/admin_sprite.png';
@icon-admin-6: 44px 186px -44px -186px 8px 8px 313px 206px '../images/dist/admin_sprite.png' 'icon-admin_6';
@icon-admin-7-name: 'icon-admin_7';
@icon-admin-7-x: 213px;
@icon-admin-7-y: 124px;
@icon-admin-7-offset-x: -213px;
@icon-admin-7-offset-y: -124px;
@icon-admin-7-width: 100px;
@icon-admin-7-height: 56px;
@icon-admin-7-total-width: 313px;
@icon-admin-7-total-height: 206px;
@icon-admin-7-image: '../images/dist/admin_sprite.png';
@icon-admin-7: 213px 124px -213px -124px 100px 56px 313px 206px '../images/dist/admin_sprite.png' 'icon-admin_7';
@icon-admin-9-name: 'icon-admin_9';
@icon-admin-9-x: 213px;
@icon-admin-9-y: 62px;
@icon-admin-9-offset-x: -213px;
@icon-admin-9-offset-y: -62px;
@icon-admin-9-width: 100px;
@icon-admin-9-height: 56px;
@icon-admin-9-total-width: 313px;
@icon-admin-9-total-height: 206px;
@icon-admin-9-image: '../images/dist/admin_sprite.png';
@icon-admin-9: 213px 62px -213px -62px 100px 56px 313px 206px '../images/dist/admin_sprite.png' 'icon-admin_9';
@icon-angle-name: 'icon-angle';
@icon-angle-x: 72px;
@icon-angle-y: 186px;
@icon-angle-offset-x: -72px;
@icon-angle-offset-y: -186px;
@icon-angle-width: 8px;
@icon-angle-height: 8px;
@icon-angle-total-width: 313px;
@icon-angle-total-height: 206px;
@icon-angle-image: '../images/dist/admin_sprite.png';
@icon-angle: 72px 186px -72px -186px 8px 8px 313px 206px '../images/dist/admin_sprite.png' 'icon-angle';
@spritesheet-width: 313px;
@spritesheet-height: 206px;
@spritesheet-image: '../images/dist/admin_sprite.png';
@spritesheet-sprites: @icon-admin-10 @icon-admin-11 @icon-admin-12 @icon-admin-13 @icon-admin-14 @icon-admin-15 @icon-admin-2 @icon-admin-3 @icon-admin-4 @icon-admin-5 @icon-admin-6 @icon-admin-7 @icon-admin-9 @icon-angle;
@spritesheet: 313px 206px '../images/dist/admin_sprite.png' @spritesheet-sprites;
/*
The provided classes are intended to be used with the array-like variables
.icon-home {
.sprite-width(@icon-home);
}
.icon-email {
.sprite(@icon-email);
}
*/
.sprite-width(@sprite) {
width: extract(@sprite, 5);
}
.sprite-height(@sprite) {
height: extract(@sprite, 6);
}
.sprite-position(@sprite) {
@sprite-offset-x: extract(@sprite, 3);
@sprite-offset-y: extract(@sprite, 4);
background-position: @sprite-offset-x @sprite-offset-y;
}
.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);
}
/*
The `.sprites` mixin generates identical output to the CSS template
but can be overridden inside of LESS
This must be run when you have at least 2 sprites.
If run with a single sprite, then there will be reference errors.
.sprites(@spritesheet-sprites);
*/
.sprites(@sprites, @i: 1) when (@i <= length(@sprites)) {
@sprite: extract(@sprites, @i);
@sprite-name: e(extract(@sprite, 10));
.@{sprite-name} {
.sprite(@sprite);
}
.sprites(@sprites, @i + 1);
}