提交 | 用户 | 时间
|
58d006
|
1 |
//some file input variables |
A |
2 |
@file-input-bg:#FFF; |
|
3 |
@file-input-border:#D5D5D5; |
|
4 |
@file-input-shadow:~"0 0 0 4px rgba(0,0,0,0.06)"; |
|
5 |
|
|
6 |
@file-input-hover-border:#F59942; |
|
7 |
@file-input-hover-shadow:~"0 0 0 4px rgba(245, 153, 66, 0.3)"; |
|
8 |
|
|
9 |
@file-input-btn-bg:#6FB3E0; |
|
10 |
@file-input-name-color:#888; |
|
11 |
@file-input-selected-name-color:#666; |
|
12 |
|
|
13 |
@file-input-icon-bg:#D1D1D1;//!ignore |
|
14 |
@file-input-selected-icon-bg:#EFAD62;//!ignore |
|
15 |
@file-input-selected-icon-picture-bg:#BD7A9D;//!ignore |
|
16 |
@file-input-selected-icon-film-bg:#87B87F;//!ignore |
|
17 |
@file-input-selected-icon-music-bg:#8B7AC9;//!ignore |
|
18 |
@file-input-selected-icon-archive-bg:#EFAD62;//!ignore |
|
19 |
|
|
20 |
@file-remove-bg:#FB7142; |
|
21 |
@file-multi-remove-color:#F4C0B1; |
|
22 |
@file-multi-border:#AAA; |
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
.enable_file_input() when(@enable-file-input = true) { |
|
27 |
|
|
28 |
.ace-file-input { |
|
29 |
display: block; |
|
30 |
font-size: inherit; |
|
31 |
|
|
32 |
position: relative; |
|
33 |
height: 30px; |
|
34 |
//line-height: 38px; |
|
35 |
|
|
36 |
//margin-bottom: 9px; |
|
37 |
|
|
38 |
input[type=file] { |
|
39 |
position: absolute; |
|
40 |
z-index: -999; |
|
41 |
|
|
42 |
width: 1px; |
|
43 |
height: 1px; |
|
44 |
overflow: hidden; |
|
45 |
|
|
46 |
.opacity(0); |
|
47 |
&:focus { |
|
48 |
outline: none; |
|
49 |
} |
|
50 |
} |
|
51 |
|
|
52 |
|
|
53 |
.ace-file-container { |
|
54 |
display: block; |
|
55 |
position: absolute; |
|
56 |
top: 0; |
|
57 |
left: 0; |
|
58 |
right: 0; |
|
59 |
height: 30px; |
|
60 |
|
|
61 |
background-color:@file-input-bg; |
|
62 |
border:1px solid @file-input-border; |
|
63 |
|
|
64 |
cursor:pointer; |
|
65 |
|
|
66 |
//.box-shadow(@file-input-shadow); |
|
67 |
.box-shadow(none); |
|
68 |
|
|
69 |
.transition(~"all 0.15s"); |
|
70 |
|
|
71 |
&:hover { |
|
72 |
//.box-shadow(@file-input-hover-shadow); |
|
73 |
.box-shadow(none); |
|
74 |
border-color:@file-input-hover-border; |
|
75 |
} |
|
76 |
//the button |
|
77 |
&:before { |
|
78 |
display: inline-block; |
|
79 |
content: attr(data-title); |
|
80 |
|
|
81 |
position: absolute; |
|
82 |
right: 0; |
|
83 |
top: 0; |
|
84 |
bottom: 0; |
|
85 |
|
|
86 |
line-height: 24px; |
|
87 |
text-align: center; |
|
88 |
padding: 0 8px; |
|
89 |
|
|
90 |
background-color: @file-input-btn-bg; |
|
91 |
color: #FFF; |
|
92 |
font-size: @font-size-file-input-btn; |
|
93 |
font-weight: bold; |
|
94 |
|
|
95 |
border: 2px solid #FFF; |
|
96 |
border-left-width: 4px; |
|
97 |
|
|
98 |
.transition(~"all 0.3s"); |
|
99 |
} |
|
100 |
|
|
101 |
|
|
102 |
.ace-file-name { //the file name container |
|
103 |
display: inline-block; |
|
104 |
height: 28px; |
|
105 |
max-width: 80%; |
|
106 |
white-space: nowrap; |
|
107 |
overflow: hidden; |
|
108 |
line-height: 28px; |
|
109 |
color:@file-input-name-color; |
|
110 |
font-size: @font-size-file-input-name; |
|
111 |
vertical-align: top; |
|
112 |
|
|
113 |
position: static; |
|
114 |
padding-left: 30px; |
|
115 |
|
|
116 |
&:after { //the file name |
|
117 |
display: inline-block; |
|
118 |
content: attr(data-title); |
|
119 |
} |
|
120 |
} |
|
121 |
&.selected { |
|
122 |
right: 16px; |
|
123 |
.ace-file-name { |
|
124 |
color:@file-input-selected-name-color; |
|
125 |
} |
|
126 |
|
|
127 |
} |
|
128 |
|
|
129 |
.@{icon} { |
|
130 |
.ace-file-icon(); |
|
131 |
background-color:@file-input-icon-bg;//should be here |
|
132 |
} |
|
133 |
&.selected .ace-file-name { |
|
134 |
.@{icon} { |
|
135 |
background-color:@file-input-selected-icon-bg; |
|
136 |
} |
|
137 |
.file-image { |
|
138 |
background-color:@file-input-selected-icon-picture-bg; |
|
139 |
} |
|
140 |
.file-video { |
|
141 |
background-color:@file-input-selected-icon-film-bg; |
|
142 |
} |
|
143 |
.file-audio { |
|
144 |
background-color:@file-input-selected-icon-music-bg; |
|
145 |
} |
|
146 |
.file-archive { |
|
147 |
background-color:@file-input-selected-icon-archive-bg; |
|
148 |
} |
|
149 |
} |
|
150 |
&.hide-placeholder:before { |
|
151 |
display:none; |
|
152 |
} |
|
153 |
|
|
154 |
} |
|
155 |
|
|
156 |
a:hover{ |
|
157 |
text-decoration:none; |
|
158 |
} |
|
159 |
.remove { // the remove button |
|
160 |
position: absolute; |
|
161 |
right: -8px; |
|
162 |
top: 6px; |
|
163 |
display: none; |
|
164 |
|
|
165 |
width: 17px; |
|
166 |
text-align: center; |
|
167 |
height: 17px; |
|
168 |
line-height: 15px; |
|
169 |
|
|
170 |
font-size: @font-size-file-input-reset; |
|
171 |
font-weight: normal; |
|
172 |
|
|
173 |
background-color: @file-remove-bg; |
|
174 |
.border-radius(100%); |
|
175 |
color: #FFF; |
|
176 |
text-decoration: none; |
|
177 |
} |
|
178 |
.ace-file-container.selected + .remove { |
|
179 |
display: inline-block; |
|
180 |
} |
|
181 |
|
|
182 |
} |
|
183 |
|
|
184 |
|
|
185 |
@media screen and (-webkit-min-device-pixel-ratio:0) { |
|
186 |
.ace-file-input input[type=file] { |
|
187 |
position: absolute; |
|
188 |
width: 0; height: 0; |
|
189 |
} |
|
190 |
} |
|
191 |
|
|
192 |
|
|
193 |
|
|
194 |
.ace-file-input input[type=file] { |
|
195 |
&.disabled , &[disabled] , &[readonly] { |
|
196 |
+ .ace-file-container { |
|
197 |
cursor: not-allowed; |
|
198 |
background-color:#EEE; |
|
199 |
&:hover { |
|
200 |
//box-shadow: 0 0 0 4px rgba(0,0,0,0.06); |
|
201 |
.box-shadow(none); |
|
202 |
border-color:#E3E3E3; |
|
203 |
} |
|
204 |
&:before { |
|
205 |
border-color:#EEE; |
|
206 |
background-color:#A1AAAF; |
|
207 |
} |
|
208 |
} |
|
209 |
} |
|
210 |
&[readonly] + .ace-file-container { |
|
211 |
cursor:default; |
|
212 |
} |
|
213 |
} |
|
214 |
|
|
215 |
|
|
216 |
.ace-file-icon() { |
|
217 |
display: inline-block; |
|
218 |
position: absolute; |
|
219 |
left: 0; |
|
220 |
top: 0; |
|
221 |
bottom: 0; |
|
222 |
line-height: 24px; |
|
223 |
width: 26px; |
|
224 |
text-align: center; |
|
225 |
|
|
226 |
font-family: FontAwesome; |
|
227 |
font-size: @font-size-file-input-icon; |
|
228 |
|
|
229 |
border: 2px solid #FFF; |
|
230 |
|
|
231 |
color: #FFF; |
|
232 |
|
|
233 |
.transition(~"all 0.1s"); |
|
234 |
} |
|
235 |
|
|
236 |
.ace-file-input .ace-file-overlay { |
|
237 |
position: absolute; |
|
238 |
top: -2px; |
|
239 |
bottom: -2px; |
|
240 |
left: -2px; |
|
241 |
right: -10px; |
|
242 |
z-index: 99; |
|
243 |
background-color: rgba(0,0,0,0.5); |
|
244 |
|
|
245 |
> .overlay-content { |
|
246 |
display: inline-block; |
|
247 |
position: relative; |
|
248 |
top: 10%; |
|
249 |
left: 0; |
|
250 |
right: 0; |
|
251 |
text-align: center; |
|
252 |
} |
|
253 |
} |
|
254 |
|
|
255 |
|
|
256 |
|
|
257 |
|
|
258 |
|
|
259 |
.enable_file_input_multiple() when(@enable-file-input-multiple = true) { |
|
260 |
|
|
261 |
.ace-file-multiple { |
|
262 |
height:auto; |
|
263 |
.ace-file-container { |
|
264 |
position:relative; |
|
265 |
height:auto; |
|
266 |
border:1px dashed @file-multi-border; |
|
267 |
border-radius:4px; |
|
268 |
text-align:center; |
|
269 |
|
|
270 |
&:before {//the button |
|
271 |
display: inline-block; |
|
272 |
content: attr(data-title); |
|
273 |
|
|
274 |
position: relative; |
|
275 |
right: 0; |
|
276 |
left: 0; |
|
277 |
margin: 12px; |
|
278 |
line-height: 22px; |
|
279 |
|
|
280 |
background-color: #FFF; |
|
281 |
color: #CCC; |
|
282 |
font-size: @font-size-file-input-name-large; |
|
283 |
font-weight: bold; |
|
284 |
|
|
285 |
border-width: 0; |
|
286 |
} |
|
287 |
&.selected .ace-file-name .@{icon} { |
|
288 |
.ace-file-icon(); |
|
289 |
} |
|
290 |
|
|
291 |
|
|
292 |
.ace-file-name { |
|
293 |
position: relative; |
|
294 |
display: block; |
|
295 |
padding: 0; |
|
296 |
height: auto; |
|
297 |
width: auto; |
|
298 |
max-width: 100%; |
|
299 |
margin: 0 4px; |
|
300 |
border-bottom: 1px solid #DDD; |
|
301 |
text-align: left; |
|
302 |
|
|
303 |
&:first-child { |
|
304 |
margin-top: 1px; |
|
305 |
} |
|
306 |
&:last-child { |
|
307 |
border-bottom-width: 0; |
|
308 |
margin-bottom: 1px; |
|
309 |
} |
|
310 |
img { |
|
311 |
padding: 2px; |
|
312 |
border: 1px solid #D7D7D7; |
|
313 |
background-color: #FFF; |
|
314 |
background-repeat: no-repeat; |
|
315 |
background-position: center; |
|
316 |
|
|
317 |
margin: 4px 8px 4px 1px; |
|
318 |
} |
|
319 |
&:after {//the file name |
|
320 |
display: none; |
|
321 |
} |
|
322 |
} |
|
323 |
&.selected .ace-file-name:after {//the file name |
|
324 |
display: inline-block; |
|
325 |
white-space: pre; |
|
326 |
} |
|
327 |
.ace-file-name img + .@{icon} , &.selected .ace-file-name img + .@{icon} { |
|
328 |
display: none; |
|
329 |
} |
|
330 |
|
|
331 |
} |
|
332 |
|
|
333 |
|
|
334 |
.remove { |
|
335 |
right: -11px; |
|
336 |
top: -11px; |
|
337 |
border: 3px solid #BBB; |
|
338 |
border-radius: 32px; |
|
339 |
|
|
340 |
background-color: #FFF; |
|
341 |
color: red; |
|
342 |
|
|
343 |
width: 23px; |
|
344 |
height: 23px; |
|
345 |
line-height: 16px; |
|
346 |
} |
|
347 |
.ace-file-container.selected + .remove:hover { |
|
348 |
border-color: @file-multi-remove-color; |
|
349 |
} |
|
350 |
|
|
351 |
|
|
352 |
.ace-file-overlay { |
|
353 |
position: absolute; |
|
354 |
top: -12px; |
|
355 |
bottom: -6px; |
|
356 |
left: -12px; |
|
357 |
right: -12px; |
|
358 |
|
|
359 |
> .overlay-content { |
|
360 |
top: 20%; |
|
361 |
} |
|
362 |
} |
|
363 |
} |
|
364 |
|
|
365 |
|
|
366 |
|
|
367 |
|
|
368 |
|
|
369 |
.ace-file-multiple .ace-file-container { |
|
370 |
.ace-file-name .@{icon} { |
|
371 |
position: relative; |
|
372 |
display: block; |
|
373 |
text-align: center; |
|
374 |
height: auto; |
|
375 |
line-height: 64px; |
|
376 |
width: auto; |
|
377 |
|
|
378 |
font-size: @font-size-file-input-icon-large; |
|
379 |
color: #D5D5D5; |
|
380 |
|
|
381 |
margin: 4px 0; |
|
382 |
|
|
383 |
background-color: transparent; |
|
384 |
} |
|
385 |
|
|
386 |
&.selected:after { |
|
387 |
display:none; |
|
388 |
} |
|
389 |
&.selected .ace-file-name .@{icon} { |
|
390 |
position:relative; |
|
391 |
margin-right:4px; margin-left:2px; |
|
392 |
line-height:24px; |
|
393 |
} |
|
394 |
|
|
395 |
|
|
396 |
.ace-file-name.large { |
|
397 |
text-align: center; |
|
398 |
border-bottom: 1px solid #222; |
|
399 |
margin: 0 1px 3px; |
|
400 |
|
|
401 |
&:last-child { |
|
402 |
margin: 0 1px; |
|
403 |
//border-bottom-width: 0; |
|
404 |
} |
|
405 |
&:after { //image caption |
|
406 |
position: absolute; |
|
407 |
top: auto; |
|
408 |
bottom: 0; |
|
409 |
left: 0; |
|
410 |
right: 0; |
|
411 |
padding: 0 4px; |
|
412 |
background-color: #555; |
|
413 |
color: #FFF; |
|
414 |
.opacity(0.8); |
|
415 |
} |
|
416 |
|
|
417 |
img { |
|
418 |
border-width: 0; |
|
419 |
margin: 0 !important;//to override .RTL's |
|
420 |
padding: 0; |
|
421 |
} |
|
422 |
} |
|
423 |
|
|
424 |
} |
|
425 |
|
|
426 |
|
|
427 |
|
|
428 |
|
|
429 |
|
|
430 |
|
|
431 |
.ace-file-multiple input[type=file] { |
|
432 |
&.disabled , &[disabled] , &[readonly] { |
|
433 |
+ .ace-file-container { |
|
434 |
&:hover { |
|
435 |
border-color:#AAA; |
|
436 |
} |
|
437 |
&:before { |
|
438 |
background-color:transparent; |
|
439 |
} |
|
440 |
|
|
441 |
.@{icon} { |
|
442 |
border-color:#EEE; |
|
443 |
} |
|
444 |
} |
|
445 |
} |
|
446 |
} |
|
447 |
|
|
448 |
} |
|
449 |
.enable_file_input_multiple(); |
|
450 |
|
|
451 |
|
|
452 |
|
|
453 |
} |
|
454 |
.enable_file_input(); |