-
Notifications
You must be signed in to change notification settings - Fork 0
/
_helper.sass
121 lines (106 loc) · 6.82 KB
/
_helper.sass
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
=easy-sizing($width, $height: $width)
width: #{$width}px
height: #{$height}px
=easy-position($position,$direction,$hsize,$vsize)
position: #{$position}
@if $direction == top or $direction == topleft or $direction == topright
top: #{$hsize}px
@if $direction == left or $direction == topleft or $direction == bottomleft
left: #{$vsize}px
@if $direction == right or $direction == topright or $direction == bottomright
right: #{$vsize}px
@if $direction == bottom or $direction == bottomleft or $direction == bottomright
bottom: #{$hsize}px
=easy-radius($size)
border-radius: #{$size}px
-webkit-border-radius: #{$size}px
-moz-border-radius: #{$size}px
-o-border-radius: #{$size}px
-ms-border-radius: #{$size}px
=easy-quarter-radius($hdirection,$vdirection,$size)
border-#{$hdirection}-#{$vdirection}-radius: #{$size}px
-webkit-border-#{$hdirection}-#{$vdirection}-radius: #{$size}px
-moz-border-radius-#{$hdirection}#{$vdirection}: #{$size}px
-ms-border-radius-#{$hdirection}#{$vdirection}: #{$size}px
-o-border-radius-#{$hdirection}#{$vdirection}: #{$size}px
=easy-half-radius($direction,$size)
@if $direction == top or $direction == right
+easy-quarter-radius(top,right,#{$size})
@if $direction == top or $direction == left
+easy-quarter-radius(top,left,#{$size})
@if $direction == bottom or $direction == right
+easy-quarter-radius(bottom,right,#{$size})
@if $direction == bottom or $direction == left
+easy-quarter-radius(bottom,left,#{$size})
=easy-background-size($width, $height: $width)
background-size: #{$width}px #{$height}px
-webkit-background-size: #{$width}px #{$height}px
-moz-background-size: #{$width}px #{$height}px
-ms-background-size: #{$width}px #{$height}px
-o-background-size: #{$width}px #{$height}px
=easy-box-shadow($x,$y,$glow,$color)
box-shadow: #{$x}px #{$y}px #{$glow}px #{$color}
-webkit-box-shadow: #{$x}px #{$y}px #{$glow}px #{$color}
-moz-box-shadow: #{$x}px #{$y}px #{$glow}px #{$color}
-ms-box-shadow: #{$x}px #{$y}px #{$glow}px #{$color}
-o-box-shadow: #{$x}px #{$y}px #{$glow}px #{$color}
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(color=#{$color},direction=180,strength=2,enabled=true)"
=easy-multiple-background($url1,$url2)
background: url(#{$url1}) no-repeat, url(#{$url2}) no-repeat
*background: transparent url(#{$url2})
background: transparent url(#{$url2})\9
-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader (src=#{$url1}, sizingMethod='crop')"
=easy-box-shadow-i($x,$y,$glow,$color)
box-shadow: inset #{$x}px #{$y}px #{$glow}px #{$color}
-webkit-box-shadow: inset #{$x}px #{$y}px #{$glow}px #{$color}
-moz-box-shadow: inset #{$x}px #{$y}px #{$glow}px #{$color}
-ms-box-shadow: inset #{$x}px #{$y}px #{$glow}px #{$color}
-o-box-shadow: inset #{$x}px #{$y}px #{$glow}px #{$color}
=easy-box-shadow-2($x,$y,$glow,$color,$x2,$y2,$glow2,$color2)
box-shadow: #{$x}px #{$y}px #{$glow}px #{$color}, #{$x2}px #{$y2}px #{$glow2}px #{$color2}
-webkit-box-shadow: #{$x}px #{$y}px #{$glow}px #{$color}, #{$x2}px #{$y2}px #{$glow2}px #{$color2}
-moz-box-shadow: #{$x}px #{$y}px #{$glow}px #{$color}, #{$x2}px #{$y2}px #{$glow2}px #{$color2}
-ms-box-shadow: #{$x}px #{$y}px #{$glow}px #{$color}, #{$x2}px #{$y2}px #{$glow2}px #{$color2}
-o-box-shadow: #{$x}px #{$y}px #{$glow}px #{$color}, #{$x2}px #{$y2}px #{$glow2}px #{$color2}
=easy-box-shadow-2i($x,$y,$glow,$color,$x2,$y2,$glow2,$color2)
box-shadow: #{$x}px #{$y}px #{$glow}px #{$color}, inset #{$x2}px #{$y2}px #{$glow2}px #{$color2}
-webkit-box-shadow: #{$x}px #{$y}px #{$glow}px #{$color}, inset #{$x2}px #{$y2}px #{$glow2}px #{$color2}
-moz-box-shadow: #{$x}px #{$y}px #{$glow}px #{$color}, inset #{$x2}px #{$y2}px #{$glow2}px #{$color2}
-ms-box-shadow: #{$x}px #{$y}px #{$glow}px #{$color}, inset #{$x2}px #{$y2}px #{$glow2}px #{$color2}
-o-box-shadow: #{$x}px #{$y}px #{$glow}px #{$color}, inset #{$x2}px #{$y2}px #{$glow2}px #{$color2}
=easy-box-shadow-i2($x,$y,$glow,$color,$x2,$y2,$glow2,$color2)
box-shadow: inset #{$x}px #{$y}px #{$glow}px #{$color}, inset #{$x2}px #{$y2}px #{$glow2}px #{$color2}
-webkit-box-shadow: inset #{$x}px #{$y}px #{$glow}px #{$color}, inset #{$x2}px #{$y2}px #{$glow2}px #{$color2}
-moz-box-shadow: inset #{$x}px #{$y}px #{$glow}px #{$color}, inset #{$x2}px #{$y2}px #{$glow2}px #{$color2}
-ms-box-shadow: inset #{$x}px #{$y}px #{$glow}px #{$color}, inset #{$x2}px #{$y2}px #{$glow2}px #{$color2}
-o-box-shadow: inset #{$x}px #{$y}px #{$glow}px #{$color}, inset #{$x2}px #{$y2}px #{$glow2}px #{$color2}
=easy-gradient($start,$end)
background-color: #{$start}
background-image: linear-gradient(#{$start} 0%, #{$end} 100%)
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #{$start}), color-stop(1, #{$end}))
background-image: -moz-linear-gradient(#{$start} 0%, #{$end} 100%)
background-image: -ms-linear-gradient(#{$start}, #{$end})
background-image: -o-linear-gradient(#{$start}, #{$end})
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#{$start}, endColorstr=#{$end})"
=easy-gradient-3($start,$mid,$end)
background-color: #{$start}
background-image: linear-gradient(#{$start} 0%, #{$mid} 50%, #{$end} 100%)
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #{$start}), color-stop(0.5, #{$mid}), color-stop(1, #{$end}))
background-image: -moz-linear-gradient(#{$start} 0%, #{$mid} 50%, #{$end} 100%)
background-image: -ms-linear-gradient(#{$start} 0%, #{$mid} 50%, #{$end} 100%)
background-image: -o-linear-gradient(#{$start} 0%, #{$mid} 50%, #{$end} 100%)
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#{$start}, endColorstr=#{$end})"
=easy-gradient-4($start,$mid1,$mid2,$end)
background-color: #{$start}
background-image: linear-gradient(#{$start} 0%, #{$mid1} 50%, #{$mid2} 50%, #{$end} 100%)
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #{$start}), color-stop(0.5, #{$mid1}), color-stop(0.5, #{$mid2}), color-stop(1, #{$end}))
background-image: -moz-linear-gradient(#{$start} 0%, #{$mid1} 50%, #{$mid2} 50%, #{$end} 100%)
background-image: -ms-linear-gradient(#{$start} 0%, #{$mid1} 50%, #{$mid2} 50%, #{$end} 100%)
background-image: -o-linear-gradient(#{$start} 0%, #{$mid1} 50%, #{$mid2} 50%, #{$end} 100%)
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#{$start}, endColorstr=#{$end})"
=easy-transition($duration, $property: all, $timing-function: ease)
transition: #{$property} #{$duration}s #{$timing-function}
-webkit-transition: #{$property} #{$duration}s #{$timing-function}
moz-transition: #{$property} #{$duration}s #{$timing-function}
-o-transition: #{$property} #{$duration}s #{$timing-function}
-ms-transition: #{$property} #{$duration}s #{$timing-function}