-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_mixins.scss
81 lines (56 loc) · 2.68 KB
/
_mixins.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
/*********************
TRANSITION
Use to apply element transitions
Easing curves: ease, linear, ease-in, ease-out, ease-in-out
Example: @include transition(all,350ms,ease-out);
Example: Complex curve: @include transition(all,350ms,cubic-bezier(.87,-0.41,.19,1.44));
*********************/
@mixin transition($property: null, $duration: null, $curve: null) {
@if($property == null) { $property: all; }
@if($duration == null) { $duration: 400ms; }
@if($curve == null) { $curve: ease; }
-webkit-transition: $property $duration $curve !important;
-moz-transition: $property $duration $curve !important;
-ms-transition: $property $duration $curve !important;
-o-transition: $property $duration $curve !important;
transition: $property $duration $curve !important;
}
/*********************
OPACITY
Use to apply element opacity
*********************/
@mixin opacity($decimal,$percent) {
-moz-opacity: $decimal !important;
-khtml-opacity: $decimal !important;
opacity: $decimal !important;
-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=$percent) !important;
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=$percent) !important;
filter:alpha(opacity=$percent) !important;
}
/*********************
FLEX
*********************/
@mixin displayflex() {
display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */
display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */
display: -ms-flexbox; /* TWEENER - IE 10 */
display: -webkit-flex; /* NEW - Chrome */
display: flex;
}
/*********************
TRANSFORM MIXIN
Usage: @include transform($rotate,$scale,$skew,$translateX,$translateY,$translateZ);
*********************/
@mixin transform($rotate: null, $scale: null, $skew: null, $translateX: null, $translateY: null, $translateZ: null) {
@if($rotate == null) { $rotate: 0deg; }
@if($scale == null) { $scale: 1; }
@if($skew == null) { $skew: 0deg; }
@if($translateX == null) { $translateX: 0%; }
@if($translateY == null) { $translateY: 0%; }
@if($translateZ == null) { $translateZ: 0%; }
transform: rotate($rotate) scale($scale) skew($skew) translateX($translateX) translateY($translateY) translateZ($translateZ);
-webkit-transform: rotate($rotate) scale($scale) skew($skew) translateX($translateX) translateY($translateY) translateZ($translateZ);
-moz-transform: rotate($rotate) scale($scale) skew($skew) translateX($translateX) translateY($translateY) translateZ($translateZ);
-o-transform: rotate($rotate) scale($scale) skew($skew) translateX($translateX) translateY($translateY) translateZ($translateZ);
-ms-transform: rotate($rotate) scale($scale) skew($skew) translateX($translateX) translateY($translateY) translateZ($translateZ);
}