forked from bozboz/luigi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_css3.scss
executable file
·134 lines (111 loc) · 3.09 KB
/
_css3.scss
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
@mixin keyframes($name){
@-webkit-keyframes$name{
@content;
}
@-moz-keyframes$name{
@content;
}
@-o-keyframes$name{
@content;
}
@keyframes$name{
@content;
}
}
@mixin animation($animation...) {
@each $prefix in $vendors-no-ms {
#{$prefix}animation: $animation;
}
}
@mixin bg-size($size) {
-webkit-background-size: $size; // Safari 3-4
background-size: $size; // Chrome, Firefox 4+, IE 9+, Opera, Safari 5+
}
@mixin border-radius-noclip($radius) {
-webkit-border-radius: $radius;
border-radius: $radius;
}
@mixin border-radius($radius) {
@include border-radius-noclip($radius);
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
@mixin box-shadow($shadow: 0px 5px 5px 2px rgba(0, 0, 0, 0.3)) {
-webkit-box-shadow: $shadow;
box-shadow: $shadow;
}
@mixin box-sizing($box: border-box) {
-webkit-box-sizing: $box;
-moz-box-sizing: $box;
box-sizing: $box;
}
@mixin color-alpha($theme, $alpha: 0.5, $property: 'background-color') {
#{$property}: $theme; //fallback
#{$property}: rgba($theme, $alpha);
}
// Gradient mixin for vertical, horizonal and diagonal
// Usage:
// @include gradient(h, #f00, #0f0);
@mixin gradient($type, $start, $end, $degrees: false) {
$gradient: linear;
$direction: top;
$to-direction: bottom;
$ie-type: 1;
@if $type == h {
$direction: left;
$to-direction: right;
$ie-type: 1;
} @else if $type == d {
$direction: #{$degrees}deg;
}
background: $end; // Old browsers
@each $vendor in $vendors-no-ms {
background: #{$vendor}#{$gradient}-gradient($direction, $start 0%, $end 100%);
}
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#{$start}', endColorstr='#{$end}',GradientType=#{$ie-type});
}
@mixin gradient-radial($size, $shape, $position, $fallback, $colors...){
$type: 'radial';
background: $fallback;
@each $vendor in $vendors-no-w3c {
background: #{$vendor}#{$type}-gradient($position, $size $shape, $colors);
}
background: #{$type}-gradient($size $shape at $position, $colors);
}
@mixin opacity($opacity: 50) {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=" $opacity ")";
filter: alpha(opacity=$opacity);
opacity: $opacity / 100;
zoom: 1;
}
@mixin transition($time: 0.2s, $attr: all, $effect: ease, $webkit-transform: false) {
@each $vendor in $vendors-no-ms {
#{$vendor}transition: $time $attr $effect;
}
@if $webkit-transform {
-webkit-backface-visibility: hidden;
}
}
@mixin transition-property($attr, $value) {
@each $vendor in $vendors-no-ms {
#{$vendor}transition-#{$attr}: $value;
}
}
@mixin transition-transform($attr...) {
$trans: (transform);
-webkit-transition-property: append(-webkit-#{$trans}, $attr, comma);
-o-transition-property: append(-webkit-#{$trans}, $attr, comma);
transition-property: append(-webkit-#{$trans}, $attr, comma);
transition-property: $trans, $attr;
}
@mixin transform($trans) {
@each $vendor in $vendors{
#{$vendor}transform: $trans;
}
}
@mixin transform-property($attr, $value) {
@each $vendor in $vendors {
#{$vendor}transform-#{$attr}: $value;
}
}