-
Notifications
You must be signed in to change notification settings - Fork 0
/
_opacity.less
35 lines (33 loc) · 1.18 KB
/
_opacity.less
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
/**
* less css: OPACITY
*
* Collection of common lesscss mixins to create cross browser css3 rules.
* Rules are mainly gathered from http://css3please.com and http://net.tutsplus.com/tutorials/php/how-to-squeeze-the-most-out-of-less
* And are re-written to lesscss mixins (http://lesscss.org)
*
* @section lesscss-mixins
* @subsection opacity
* @author Jasper Moelker <[email protected]>
*/
/**
* @function .opacity
* @param {Number} opacity expects value between 0 and 1
* @return cross browser opacity
*/
.opacity(@opacity){
-moz-opacity: @opacity;
opacity: @opacity;
}
/**
* extended opacity rule with IE filter (http://freestyle-developments.co.uk/blog/?p=400)
* @function .opacityFilter
* @param {Number} opacity expects value between 0 and 1
* @return cross browser opacity with IE filter
*/
.opacityFilter(@opacity){
@ieOpacity: @opacity * 100;
-ms-filter: ~"progid:DXImageTransform.Microsoft.Alpha(Opacity=@{ieOpacity})"; // IE 8
filter: ~"alpha(opacity=@{ieOpacity})"; // IE 5-7
-moz-opacity: @opacity;
opacity: @opacity;
}