-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.styl
111 lines (95 loc) · 3.83 KB
/
index.styl
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
$IE_COMPATIBILITY ?= true
fif(cond,rthen,relse)
if cond
rthen
else
relse
findBestFgColor(backgroundColor,blackColor=#333,whiteColor=#fdfdfd)
unless backgroundColor is a 'rgba'
error('expected a rgba, but got ' + typeof(backgroundColor))
if backgroundColor is a 'hash'
backgroundColor = backgroundColor[0]
unless backgroundColor is a 'rgba'
error('expected a rgba, but got ' + typeof(backgroundColor))
fif lightness(backgroundColor) > 55 blackColor whiteColor
/* fif dark(backgroundColor) blackColor whiteColor*/
isBoolean(val)
p(val)
boxShadow($color,$blur=false,$hOffset=0,$vOffset=0,$spread=false,$inset=false)
$color = 0 if $color == none
if $color == 0
box-shadow 0
else
if length($color) > 1
$blur = $color[1]
$color = $color[0]
$full = $hOffset $vOffset
$full = $full $blur if $blur
$full = $full $spread if $spread
$full = $full $color
$full = inset $full if $inset
box-shadow: $full
/* http://msdn.microsoft.com/en-us/library/ms532985(v=vs.85).aspx
@if $IE_COMPATIBILITY and $inset==false{
@if $hOffset==0 and $vOffset==0 and $blur{
$max:max(-$blur/1px,$blur/1px); $min:min(-$blur/1px,$blur/1px);
filter:
progid:DXImageTransform.Microsoft.DropShadow(color='#{$color}', offX=#{$max}, offY=0),
progid:DXImageTransform.Microsoft.DropShadow(color='#{$color}', offX=#{$min}, offY=0),
progid:DXImageTransform.Microsoft.DropShadow(color='#{$color}', offX=0, offY=#{$max}),
progid:DXImageTransform.Microsoft.DropShadow(color='#{$color}', offX=0, offY=#{$min});
}@else{
@if $blur{
@if $vOffset==0{
$max:max(-$hOffset/1px,$hOffset/1px); $min:min(-$hOffset/1px,$hOffset/1px);
filter:
progid:DXImageTransform.Microsoft.DropShadow(color='#{$color}', offX=#{$max}, offY=0),
progid:DXImageTransform.Microsoft.DropShadow(color='#{$color}', offX=#{$min}, offY=0);
}@else{
$maxH:max(-$hOffset/1px,$hOffset/1px); $minH:min(-$hOffset/1px,$hOffset/1px);
$maxV:max(-$vOffset/1px,$vOffset/1px); $minV:min(-$vOffset/1px,$vOffset/1px);
filter:
progid:DXImageTransform.Microsoft.DropShadow(color='#{$color}', offX=#{$maxH}, offY=#{$maxH}),
progid:DXImageTransform.Microsoft.DropShadow(color='#{$color}', offX=#{$minH}, offY=#{$maxH}),
progid:DXImageTransform.Microsoft.DropShadow(color='#{$color}', offX=#{$maxH}, offY=#{$minV}),
progid:DXImageTransform.Microsoft.DropShadow(color='#{$color}', offX=#{$minH}, offY=#{$minV});
}
}@else{
filter:progid:DXImageTransform.Microsoft.DropShadow(color='#{$color}', offX=$hOffset, offY=$vOffset);
}
}
}
*/
/*@if $hOffset==0 and $vOffset==1px{
// http://www.marcuspope.com/blog/Less-CSS-Mixins-for-cross-browser-styles
filter:
progid:DXImageTransform.Microsoft.Shadow(color='#{$color}',direction=180,strength=4),
progid:DXImageTransform.Microsoft.Shadow(color='#{$color}',direction=225,strength=4),
progid:DXImageTransform.Microsoft.Shadow(color='#{$color}',direction=270,strength=5);
}*/
insetBoxShadow($color,$blur=false,$hOffset=0,$vOffset=0,$spread=false)
boxShadow $color $blur $hOffset $vOffset $spread true
borderRadiusBottom($length)
border-bottom-right-radius $length
border-bottom-left-radius $length
borderRadiusTop($length)
border-top-right-radius $length
border-top-left-radius $length
borderRadiusRight($length)
border-top-right-radius $length
border-bottom-right-radius $length
borderRadiusLeft($length)
border-top-left-radius $length
border-bottom-left-radius $length
border($color,$args...)
if $color is a 'color'
border: 1px solid $color $args
else if $color is not false
border: arguments
marginpadding($margin,$padding = true)
margin $margin
padding fif($padding is true,$padding,$margin)
@require 'functions/backgrounds.styl';
@require 'functions/sprites.styl';
@require 'functions/compat.styl';
@require 'functions/positions.styl';