forked from aberigle/CSSmethods
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvendor.scss
224 lines (189 loc) · 5.03 KB
/
vendor.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
@mixin vendor($prop, $args) {
@each $vendor in webkit, moz, ms, o {
-#{$vendor}-#{$prop}: $args;
#{$prop}: $args;
}
}
@mixin vendorValue($prop, $args) {
#{$prop}: -webkit- + $args;
#{$prop}: -moz- + $args;
#{$prop}: -ms- + $args;
#{$prop}: -o- + $args;
#{$prop}: $args;
}
@mixin vendorNoMS($prop, $args) {
@each $vendor in webkit, moz, o {
-#{$vendor}-#{$prop}: $args;
#{$prop}: $args;
}
}
@mixin vendorValueNoMS($prop, $args) {
#{$prop}: -webkit- + $args;
#{$prop}: -moz- + $args;
#{$prop}: -o- + $args;
#{$prop}: $args;
}
@mixin animation ($arguments) {
@include vendor("animation", $arguments);
}
@mixin animation-fill-mode {
@include vendor("animation-fill-mode", $arguments);
}
@mixin border-radius ($arguments) {
@include vendor("border-radius", $arguments);
}
@mixin box-shadow ($arguments) {
@include vendor("box-shadow", $arguments);
}
@mixin background-size ($arguments) {
@include vendor("background-size", $arguments);
}
@mixin backface-visibility($arguments) {
@include vendor("backface-visibility", $arguments);
}
/* ====================== FLEXBOX ====================== */
@mixin display-box {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
}
@mixin flex-wrap($arguments) {
-webkit-flex-wrap: $arguments;
-ms-flex-wrap: $arguments;
flex-wrap: $arguments;
}
@mixin justify-content($arguments){
@if $arguments is flex-start{
-webkit-box-pack: start;
-moz-box-pack: start;
-webkit-justify-content: flex-start;
-ms-flex-pack: start;
justify-content: flex-start;
}
@if $arguments is flex-end{
-webkit-box-pack: end;
-moz-box-pack: end;
-webkit-justify-content: flex-end;
-ms-flex-pack: end;
justify-content: flex-end;
}
@if $arguments is center{
-webkit-box-pack: center;
-moz-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
}
@if $arguments is space-between{
-webkit-box-pack: justify;
-moz-box-pack: justify;
-webkit-justify-content: space-between;
-ms-flex-pack: justify;
justify-content: space-between;
}
@if $arguments is space-around{
-webkit-box-pack: justify;
-moz-box-pack: justify;
-webkit-justify-content: space-around;
-ms-flex-pack: distribute;
justify-content: space-around;
}
}
@mixin box-align($arguments) {
@include vendor("box-align", $arguments);
-ms-flex-align: $arguments;
}
@mixin box-sizing($arguments) {
-moz-box-sizing: $arguments;
box-sizing: $arguments;
}
@mixin box-flex($arguments) {
@include vendorNoMS("box-flex", $arguments);
@if $arguments > 0 {
-ms-flex: $arguments 0 auto;
}
@else {
-ms-flex: 0 $arguments auto;
}
}
/*direction of the flex container's main axis*/
@mixin flex-direction($arguments) {
@if $arguments is horizontal {
-webkit-box-direction: normal;
-moz-box-direction: normal;
-webkit-box-orient: horizontal;
-moz-box-orient: horizontal;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
}
@else if $arguments is vertical {
-webkit-box-direction: normal;
-moz-box-direction: normal;
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
}
}
// @mixin box-direction($arguments) {
// @include vendorNoMS("box-direction", $arguments);
// -ms-flex-direction: $arguments;
// }
@mixin ordinal-group($arguments) {
@include vendorNoMS("box-ordinal-group", $arguments);
-ms-flex-order: $arguments;
}
@mixin box-lines($arguments) {
@include vendor("box-lines", $arguments);
}
/* ====================== BOXFLEX ====================== */
@mixin display-flex {
@include vendorValueNoMS("display", flex);
}
@mixin flex-flow($arguments) {
@include vendor("flex-flow", $arguments);
}
@mixin justify-content($arguments) {
@include vendor("justify-content", $arguments);
}
@mixin align-content($arguments) {
@include vendor("align-content", $arguments);
}
@mixin align-items($arguments) {
@include vendor("align-items", $arguments);
}
@mixin order($arguments) {
@include vendor("order", $arguments);
}
@mixin flex($arguments) {
@include vendor("flex", $arguments);
}
@mixin align-self($arguments) {
@include vendor("align-self", $arguments);
}
/* ====================== TRANSITIONS ====================== */
@mixin transition($arguments...) {
@include vendor("transition", $arguments);
}
@mixin transition-delay($arguments) {
@include vendor("transition-delay", $arguments);
}
@mixin transition-property($arguments) {
@include vendor("transition-property", $arguments);
}
@mixin transition-duration($arguments) {
@include vendor("transition-duration", $arguments);
}
@mixin transition-timing-function($arguments) {
@include vendor("transition-timing-function", $arguments);
}
@mixin transform($arguments) {
@include vendor("transform", $arguments);
}
@mixin transform-origin($arguments) {
@include vendor("transform-origin", $arguments);
}