tamem-scss 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +102 -0
- data/bower.json +25 -0
- data/lib/tamem/scss.rb +7 -0
- data/lib/tamem/scss/version.rb +5 -0
- data/package.json +33 -0
- data/sass/_tamem.scss +6 -0
- data/sass/core/_animation.scss +318 -0
- data/sass/core/_flexbox.scss +321 -0
- data/sass/core/_helpers.scss +452 -0
- data/sass/core/_rounded.scss +143 -0
- data/sass/core/_transformation.scss +647 -0
- data/sass/core/_transition.scss +129 -0
- data/tamem-scss.gemspec +27 -0
- metadata +73 -0
@@ -0,0 +1,321 @@
|
|
1
|
+
///
|
2
|
+
/// Flex helper
|
3
|
+
///
|
4
|
+
/// @group flexbox
|
5
|
+
/// @param {string | number} $value
|
6
|
+
///
|
7
|
+
/// @example scss
|
8
|
+
/// .box {
|
9
|
+
/// @include flex(1);
|
10
|
+
/// }
|
11
|
+
///
|
12
|
+
/// // CSS Output
|
13
|
+
/// .box {
|
14
|
+
/// -webkit-flex: 1;
|
15
|
+
/// -moz-flex: 1;
|
16
|
+
/// -ms-flex: 1;
|
17
|
+
/// -o-flex: 1;
|
18
|
+
/// }
|
19
|
+
///
|
20
|
+
@mixin flex($value) {
|
21
|
+
-webkit-flex: $value; // Chrome 21.0, Safari 6.1
|
22
|
+
-moz-flex: $value; // Firefox 18.0
|
23
|
+
-ms-flex: $value; // IE 10.0
|
24
|
+
flex: $value;
|
25
|
+
}
|
26
|
+
|
27
|
+
///
|
28
|
+
/// Flex basis helper
|
29
|
+
///
|
30
|
+
/// @group flexbox
|
31
|
+
/// @param {number} $value
|
32
|
+
///
|
33
|
+
/// @example scss
|
34
|
+
/// .box {
|
35
|
+
/// @include flex-basis(10px);
|
36
|
+
/// }
|
37
|
+
///
|
38
|
+
/// // CSS Output
|
39
|
+
/// .box {
|
40
|
+
/// -webkit-flex-basis: 10px;
|
41
|
+
/// -moz-flex-basis: 10px;
|
42
|
+
/// -o-flex-basis: 10px;
|
43
|
+
/// }
|
44
|
+
///
|
45
|
+
@mixin flex-basis($value) {
|
46
|
+
-webkit-flex-basis: $value; // Chrome 21.0, Safari 6.1
|
47
|
+
-moz-flex-basis: $value; // Firefox 18.0
|
48
|
+
flex-basis: $value;
|
49
|
+
}
|
50
|
+
|
51
|
+
///
|
52
|
+
/// Flex direction helper
|
53
|
+
///
|
54
|
+
/// @group flexbox
|
55
|
+
/// @param {string} $value
|
56
|
+
///
|
57
|
+
/// @example scss
|
58
|
+
/// .box {
|
59
|
+
/// @include flex-direction(row-reverse);
|
60
|
+
/// }
|
61
|
+
///
|
62
|
+
/// // CSS Output
|
63
|
+
/// .box {
|
64
|
+
/// -webkit-flex-direction: row-reverse;
|
65
|
+
/// -moz-flex-direction: row-reverse;
|
66
|
+
/// -o-flex-direction: row-reverse;
|
67
|
+
/// }
|
68
|
+
///
|
69
|
+
@mixin flex-direction($value) {
|
70
|
+
-webkit-flex-direction: $value; // Chrome 21.0, Safari 6.1
|
71
|
+
-moz-flex-direction: $value; // Firefox 18.0
|
72
|
+
flex-direction: $value;
|
73
|
+
}
|
74
|
+
|
75
|
+
///
|
76
|
+
/// Flex flow helper
|
77
|
+
///
|
78
|
+
/// @group flexbox
|
79
|
+
/// @param {list | string} $value
|
80
|
+
///
|
81
|
+
/// @example scss
|
82
|
+
/// .box {
|
83
|
+
/// @include flex-flow(row-reverse wrap);
|
84
|
+
/// }
|
85
|
+
///
|
86
|
+
/// // CSS Output
|
87
|
+
/// .box {
|
88
|
+
/// -webkit-flex-flow: row-reverse wrap;
|
89
|
+
/// -moz-flex-flow: row-reverse wrap;
|
90
|
+
/// -o-flex-flow: row-reverse wrap;
|
91
|
+
/// }
|
92
|
+
///
|
93
|
+
@mixin flex-flow($value) {
|
94
|
+
-webkit-flex-flow: $value; // Chrome 21.0, Safari 6.1
|
95
|
+
-moz-flex-flow: $value; // Firefox 18.0
|
96
|
+
flex-flow: $value;
|
97
|
+
}
|
98
|
+
|
99
|
+
///
|
100
|
+
/// Flex grow helper
|
101
|
+
///
|
102
|
+
/// @group flexbox
|
103
|
+
/// @param {number | string} $value
|
104
|
+
///
|
105
|
+
/// @example scss
|
106
|
+
/// .box {
|
107
|
+
/// @include flex-grow(1);
|
108
|
+
/// }
|
109
|
+
///
|
110
|
+
/// // CSS Output
|
111
|
+
/// .box {
|
112
|
+
/// -webkit-flex-grow: 1;
|
113
|
+
/// -moz-flex-grow: 1;
|
114
|
+
/// -o-flex-grow: 1;
|
115
|
+
/// }
|
116
|
+
///
|
117
|
+
@mixin flex-grow($value) {
|
118
|
+
-webkit-flex-grow: $value; // Chrome 21.0, Safari 6.1
|
119
|
+
-moz-flex-grow: $value; // Firefox 18.0
|
120
|
+
flex-grow: $value;
|
121
|
+
}
|
122
|
+
|
123
|
+
///
|
124
|
+
/// Flex shrink helper
|
125
|
+
///
|
126
|
+
/// @group flexbox
|
127
|
+
/// @param {number | string} $value
|
128
|
+
///
|
129
|
+
/// @example scss
|
130
|
+
/// .box {
|
131
|
+
/// @include flex-shrink(1);
|
132
|
+
/// }
|
133
|
+
///
|
134
|
+
/// // CSS Output
|
135
|
+
/// .box {
|
136
|
+
/// -webkit-flex-shring: 1;
|
137
|
+
/// -moz-flex-shring: 1;
|
138
|
+
/// -o-flex-shring: 1;
|
139
|
+
/// }
|
140
|
+
///
|
141
|
+
@mixin flex-shrink($value) {
|
142
|
+
-webkit-flex-shrink: $value; // Chrome 21.0, Safari 6.1
|
143
|
+
-moz-flex-shrink: $value; // Firefox 18.0
|
144
|
+
flex-shrink: $value;
|
145
|
+
}
|
146
|
+
|
147
|
+
///
|
148
|
+
/// Flex wrap helper
|
149
|
+
///
|
150
|
+
/// @group flexbox
|
151
|
+
/// @param {string} $value
|
152
|
+
///
|
153
|
+
/// @example scss
|
154
|
+
/// .box {
|
155
|
+
/// @include flex-wrap(wrap);
|
156
|
+
/// }
|
157
|
+
///
|
158
|
+
/// // CSS Output
|
159
|
+
/// .box {
|
160
|
+
/// -webkit-flex-wrap: wrap;
|
161
|
+
/// -moz-flex-wrap: wrap;
|
162
|
+
/// -o-flex-wrap: wrap;
|
163
|
+
/// }
|
164
|
+
///
|
165
|
+
@mixin flex-wrap($value) {
|
166
|
+
-webkit-flex-wrap: $value; // Chrome 21.0, Safari 6.1
|
167
|
+
-moz-flex-wrap: $value; // Firefox 18.0
|
168
|
+
flex-wrap: $value;
|
169
|
+
}
|
170
|
+
|
171
|
+
///
|
172
|
+
/// align content helper
|
173
|
+
///
|
174
|
+
/// @group flexbox
|
175
|
+
/// @param {string} $value
|
176
|
+
///
|
177
|
+
/// @example scss
|
178
|
+
/// .box {
|
179
|
+
/// @include align-content(flex-start);
|
180
|
+
/// }
|
181
|
+
///
|
182
|
+
/// // CSS Output
|
183
|
+
/// .box {
|
184
|
+
/// -webkit-align-content: flex-start;
|
185
|
+
/// align-content: flex-start;
|
186
|
+
/// }
|
187
|
+
///
|
188
|
+
@mixin align-content($value) {
|
189
|
+
-webkit-align-content: $value; // Safari 7.0
|
190
|
+
align-content: $value;
|
191
|
+
}
|
192
|
+
|
193
|
+
///
|
194
|
+
/// align items helper
|
195
|
+
///
|
196
|
+
/// @group flexbox
|
197
|
+
/// @param {string} $value
|
198
|
+
///
|
199
|
+
/// @example scss
|
200
|
+
/// .box {
|
201
|
+
/// @include align-items(flex-start);
|
202
|
+
/// }
|
203
|
+
///
|
204
|
+
/// // CSS Output
|
205
|
+
/// .box {
|
206
|
+
/// -webkit-align-items: flex-start;
|
207
|
+
/// align-items: flex-start;
|
208
|
+
/// }
|
209
|
+
///
|
210
|
+
@mixin align-items($value) {
|
211
|
+
-webkit-align-items: $value; // Safari 7.0
|
212
|
+
align-items: $value;
|
213
|
+
}
|
214
|
+
|
215
|
+
///
|
216
|
+
/// align self helper
|
217
|
+
///
|
218
|
+
/// @group flexbox
|
219
|
+
/// @param {string} $value
|
220
|
+
///
|
221
|
+
/// @example scss
|
222
|
+
/// .box {
|
223
|
+
/// @include align-self(flex-start);
|
224
|
+
/// }
|
225
|
+
///
|
226
|
+
/// // CSS Output
|
227
|
+
/// .box {
|
228
|
+
/// -webkit-align-self: flex-start;
|
229
|
+
/// align-self: flex-start;
|
230
|
+
/// }
|
231
|
+
///
|
232
|
+
@mixin align-self($value) {
|
233
|
+
-webkit-align-self: $value; // Safari 7.0
|
234
|
+
align-self: $value;
|
235
|
+
}
|
236
|
+
|
237
|
+
///
|
238
|
+
/// display flex helper
|
239
|
+
///
|
240
|
+
/// @group flexbox
|
241
|
+
///
|
242
|
+
/// @example scss
|
243
|
+
/// .box {
|
244
|
+
/// @include display-flex;
|
245
|
+
/// }
|
246
|
+
///
|
247
|
+
/// // CSS Output
|
248
|
+
/// .box {
|
249
|
+
/// display: -webkit-flex;
|
250
|
+
/// display: flex;
|
251
|
+
/// }
|
252
|
+
///
|
253
|
+
@mixin display-flex() {
|
254
|
+
display: -webkit-flex;
|
255
|
+
display: flex;
|
256
|
+
}
|
257
|
+
|
258
|
+
///
|
259
|
+
/// display inline flex helper
|
260
|
+
///
|
261
|
+
/// @group flexbox
|
262
|
+
///
|
263
|
+
/// @example scss
|
264
|
+
/// .box {
|
265
|
+
/// @include display-inline-flex;
|
266
|
+
/// }
|
267
|
+
///
|
268
|
+
/// // CSS Output
|
269
|
+
/// .box {
|
270
|
+
/// display: -webkit-inline-flex;
|
271
|
+
/// display: inline-flex;
|
272
|
+
/// }
|
273
|
+
///
|
274
|
+
@mixin display-inline-flex() {
|
275
|
+
display: -webkit-inline-flex;
|
276
|
+
display: inline-flex;
|
277
|
+
}
|
278
|
+
|
279
|
+
///
|
280
|
+
/// justify content helper
|
281
|
+
///
|
282
|
+
/// @group flexbox
|
283
|
+
/// @param {string} $value
|
284
|
+
///
|
285
|
+
/// @example scss
|
286
|
+
/// .box {
|
287
|
+
/// @include justify-content(flex-start);
|
288
|
+
/// }
|
289
|
+
///
|
290
|
+
/// // CSS Output
|
291
|
+
/// .box {
|
292
|
+
/// -webkit-justify-content: flex-start;
|
293
|
+
/// justify-content: flex-start;
|
294
|
+
/// }
|
295
|
+
///
|
296
|
+
@mixin justify-content($value) {
|
297
|
+
-webkit-justify-content: $value; // Safari 9.0
|
298
|
+
justify-content: $value;
|
299
|
+
}
|
300
|
+
|
301
|
+
///
|
302
|
+
/// order helper
|
303
|
+
///
|
304
|
+
/// @group flexbox
|
305
|
+
/// @param {number} $value
|
306
|
+
///
|
307
|
+
/// @example scss
|
308
|
+
/// .box {
|
309
|
+
/// @include order(2);
|
310
|
+
/// }
|
311
|
+
///
|
312
|
+
/// // CSS Output
|
313
|
+
/// .box {
|
314
|
+
/// -webkit-order: 2;
|
315
|
+
/// order: 2;
|
316
|
+
/// }
|
317
|
+
///
|
318
|
+
@mixin order($value) {
|
319
|
+
-webkit-order: $value; // Safari 7.0
|
320
|
+
order: $value;
|
321
|
+
}
|
@@ -0,0 +1,452 @@
|
|
1
|
+
///
|
2
|
+
/// Remove the unit of a length
|
3
|
+
/// @param {Number} $number - Number to remove unit from
|
4
|
+
/// @return {Number} - Unitless number
|
5
|
+
///
|
6
|
+
/// @example scss - strip-unit function
|
7
|
+
/// line-height: strip-unit(1.3333px);
|
8
|
+
///
|
9
|
+
/// // CSS Output
|
10
|
+
/// line-height: 1.33333;
|
11
|
+
///
|
12
|
+
@function strip-unit($number) {
|
13
|
+
@if type-of($number) == 'number' and not unitless($number) {
|
14
|
+
@return $number / ($number * 0 + 1);
|
15
|
+
}
|
16
|
+
|
17
|
+
@return $number;
|
18
|
+
}
|
19
|
+
|
20
|
+
///
|
21
|
+
/// Clearfix pseudo element
|
22
|
+
///
|
23
|
+
/// @example scss
|
24
|
+
/// .container {
|
25
|
+
/// @include clearfix;
|
26
|
+
/// }
|
27
|
+
///
|
28
|
+
/// // CSS Output
|
29
|
+
/// .container:after, .container:before {
|
30
|
+
/// display: table;
|
31
|
+
/// content: " ";
|
32
|
+
/// }
|
33
|
+
///
|
34
|
+
/// .container:after {
|
35
|
+
/// clear: both;
|
36
|
+
/// }
|
37
|
+
///
|
38
|
+
@mixin clearfix() {
|
39
|
+
&:after,
|
40
|
+
&:before {
|
41
|
+
display: table;
|
42
|
+
content: " ";
|
43
|
+
}
|
44
|
+
|
45
|
+
&:after {
|
46
|
+
clear: both;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
%clearfix {
|
51
|
+
@include clearfix();
|
52
|
+
}
|
53
|
+
|
54
|
+
///
|
55
|
+
/// create grid system
|
56
|
+
///
|
57
|
+
/// @param {string} $prefix-name - prefix name for the grid system
|
58
|
+
/// @param {number} $count - number of grid
|
59
|
+
/// @param {number} $padding-size - size of padding
|
60
|
+
///
|
61
|
+
/// @example scss
|
62
|
+
/// @include create-grid('.col-', 2, $padding-size);
|
63
|
+
///
|
64
|
+
/// // CSS Output
|
65
|
+
/// .col1, .col2 {
|
66
|
+
/// position: relative;
|
67
|
+
/// float: left;
|
68
|
+
/// min-height: 1px;
|
69
|
+
/// padding-left: 15px;
|
70
|
+
/// padding-right: 15px;
|
71
|
+
/// }
|
72
|
+
///
|
73
|
+
/// .col1 {
|
74
|
+
/// width: 50%;
|
75
|
+
/// }
|
76
|
+
/// .col2 {
|
77
|
+
/// width: 100%;
|
78
|
+
/// }
|
79
|
+
///
|
80
|
+
@mixin create-grid($prefix-name, $count, $padding-size) {
|
81
|
+
$elem: "";
|
82
|
+
@for $i from 1 through $count {
|
83
|
+
$elem: #{$elem + $prefix-name + $i};
|
84
|
+
@if $i != $count {
|
85
|
+
$elem: #{$elem + ","};
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
#{$elem} {
|
90
|
+
position: relative;
|
91
|
+
float: left;
|
92
|
+
min-height: 1px;
|
93
|
+
padding-left: $padding-size;
|
94
|
+
padding-right: $padding-size;
|
95
|
+
}
|
96
|
+
|
97
|
+
@for $i from 1 through $count {
|
98
|
+
#{$prefix-name + $i} {
|
99
|
+
width: (100 / $count) * $i * 1%;
|
100
|
+
}
|
101
|
+
}
|
102
|
+
|
103
|
+
}
|
104
|
+
|
105
|
+
///
|
106
|
+
/// create offset grid system
|
107
|
+
///
|
108
|
+
/// @param {number} $prefix-name - prefix name for grid offset system
|
109
|
+
/// @param {number} $count - number of grid offset
|
110
|
+
///
|
111
|
+
/// @example scss
|
112
|
+
/// @include create-grid-offset('.col-offset-', 2);
|
113
|
+
///
|
114
|
+
/// // CSS Output
|
115
|
+
/// .col-offset-1 {
|
116
|
+
/// margin-left: 50%;
|
117
|
+
/// }
|
118
|
+
/// .col-offset-2 {
|
119
|
+
/// margin-left: 100%;
|
120
|
+
/// }
|
121
|
+
///
|
122
|
+
@mixin create-grid-offset($prefix-name, $count) {
|
123
|
+
@for $i from 1 through $count {
|
124
|
+
#{$prefix-name + $i} {
|
125
|
+
margin-left: (100 / $count) * $i * 1%;
|
126
|
+
}
|
127
|
+
}
|
128
|
+
}
|
129
|
+
|
130
|
+
///
|
131
|
+
/// Sizing for square
|
132
|
+
///
|
133
|
+
/// @param {number} $size - size of square
|
134
|
+
///
|
135
|
+
/// @example scss
|
136
|
+
/// .box {
|
137
|
+
/// @include size(2px);
|
138
|
+
/// }
|
139
|
+
///
|
140
|
+
/// // CSS Output
|
141
|
+
/// .box {
|
142
|
+
/// width:2px;
|
143
|
+
/// height:2px;
|
144
|
+
/// }
|
145
|
+
///
|
146
|
+
@mixin square($size) {
|
147
|
+
width: $size;
|
148
|
+
height: $size;
|
149
|
+
}
|
150
|
+
|
151
|
+
///
|
152
|
+
/// Sizing pseudo element
|
153
|
+
///
|
154
|
+
/// @param {number} $width
|
155
|
+
/// @param {number} $height
|
156
|
+
///
|
157
|
+
/// @example scss
|
158
|
+
/// .box {
|
159
|
+
/// @include size(2px, 10px);
|
160
|
+
/// }
|
161
|
+
///
|
162
|
+
/// // CSS Output
|
163
|
+
/// .box {
|
164
|
+
/// width: 2px;
|
165
|
+
/// height: 10px;
|
166
|
+
/// }
|
167
|
+
///
|
168
|
+
@mixin size($width, $height) {
|
169
|
+
width: $width;
|
170
|
+
height: $height;
|
171
|
+
}
|
172
|
+
|
173
|
+
///
|
174
|
+
/// Margin top and bottom pseudo element
|
175
|
+
///
|
176
|
+
/// @param {number} $size - margin size
|
177
|
+
///
|
178
|
+
/// @example scss
|
179
|
+
/// .box {
|
180
|
+
/// @include margin-vertical(2px);
|
181
|
+
/// }
|
182
|
+
///
|
183
|
+
/// // CSS Output
|
184
|
+
/// .box {
|
185
|
+
/// margin-top: 2px;
|
186
|
+
/// margin-bottom: 2px;
|
187
|
+
/// }
|
188
|
+
///
|
189
|
+
@mixin margin-vertical($size) {
|
190
|
+
margin-top: $size;
|
191
|
+
margin-bottom: $size;
|
192
|
+
}
|
193
|
+
|
194
|
+
///
|
195
|
+
/// Margin left and right pseudo element
|
196
|
+
///
|
197
|
+
/// @param {number} $size - margin size
|
198
|
+
///
|
199
|
+
/// @example scss
|
200
|
+
/// .box {
|
201
|
+
/// @include margin-horizontal(2px);
|
202
|
+
/// }
|
203
|
+
///
|
204
|
+
/// // CSS Output
|
205
|
+
/// .box {
|
206
|
+
/// margin-left: 2px;
|
207
|
+
/// margin-right: 2px;
|
208
|
+
/// }
|
209
|
+
///
|
210
|
+
@mixin margin-horizontal($size) {
|
211
|
+
margin-left: $size;
|
212
|
+
margin-right: $size;
|
213
|
+
}
|
214
|
+
|
215
|
+
///
|
216
|
+
/// Padding top and bottom pseudo element
|
217
|
+
///
|
218
|
+
/// @param {number} $size - padding size
|
219
|
+
///
|
220
|
+
/// @example scss
|
221
|
+
/// .box {
|
222
|
+
/// @include padding-vertical(2px);
|
223
|
+
/// }
|
224
|
+
///
|
225
|
+
/// // CSS Output
|
226
|
+
/// .box {
|
227
|
+
/// padding-top: 2px;
|
228
|
+
/// padding-bottom: 2px;
|
229
|
+
/// }
|
230
|
+
///
|
231
|
+
@mixin padding-vertical($size) {
|
232
|
+
padding-top: $size;
|
233
|
+
padding-bottom: $size;
|
234
|
+
}
|
235
|
+
|
236
|
+
///
|
237
|
+
/// Padding left and right pseudo element
|
238
|
+
///
|
239
|
+
/// @param {number} $size - padding size
|
240
|
+
///
|
241
|
+
/// @example scss
|
242
|
+
/// .box {
|
243
|
+
/// @include padding-horizontal(2px);
|
244
|
+
/// }
|
245
|
+
///
|
246
|
+
/// // CSS Output
|
247
|
+
/// .box {
|
248
|
+
/// padding-left: 2px;
|
249
|
+
/// padding-right: 2px;
|
250
|
+
/// }
|
251
|
+
///
|
252
|
+
@mixin padding-horizontal($size) {
|
253
|
+
padding-left: $size;
|
254
|
+
padding-right: $size;
|
255
|
+
}
|
256
|
+
|
257
|
+
///
|
258
|
+
/// Truncating text
|
259
|
+
///
|
260
|
+
/// @example scss
|
261
|
+
/// .brand {
|
262
|
+
/// @include text-overflow;
|
263
|
+
/// }
|
264
|
+
///
|
265
|
+
/// // CSS Output
|
266
|
+
/// .brand {
|
267
|
+
/// overflow: hidden;
|
268
|
+
/// text-overflow: ellipsis;
|
269
|
+
/// white-space: nowrap;
|
270
|
+
/// }
|
271
|
+
@mixin text-overflow() {
|
272
|
+
overflow: hidden;
|
273
|
+
text-overflow: ellipsis;
|
274
|
+
white-space: nowrap;
|
275
|
+
}
|
276
|
+
|
277
|
+
///
|
278
|
+
/// Font face from local
|
279
|
+
///
|
280
|
+
/// @param {string} $font-family - Font name for used
|
281
|
+
/// @param {string} $source - Source where font have been placed. Don't add extension here
|
282
|
+
/// @param {list} $extensions - list of extensions used for font
|
283
|
+
///
|
284
|
+
/// @example scss
|
285
|
+
/// @include font-face-src('MyFont', '../fonts/MyFont', ttf otf);
|
286
|
+
///
|
287
|
+
/// // CSS Output
|
288
|
+
/// @font-face {
|
289
|
+
/// font-family: "MyFont";
|
290
|
+
/// src: url('../fonts/MyFont.ttf') format('truetype'),
|
291
|
+
/// url('../fonts/MyFont.otf') format('opentype');
|
292
|
+
/// }
|
293
|
+
///
|
294
|
+
@mixin font-face-src($font-family, $source, $extensions) {
|
295
|
+
$map: (
|
296
|
+
'eot': #{"url('#{$source}.eot#iefix')"} #{"format('embedded-opentype')"},
|
297
|
+
'woff2': #{"url('#{$source}.woff2')"} #{"format('woff2')"},
|
298
|
+
'woff': #{"url('#{$source}.woff')"} #{"format('woff')"},
|
299
|
+
'ttf': #{"url('#{$source}.ttf')"} #{"format('truetype')"},
|
300
|
+
'otf': #{"url('#{$source}.otf')"} #{"format('opentype')"},
|
301
|
+
'svg': #{"url('#{$source}.svg#svfFontName')"} #{"format('svg')"}
|
302
|
+
);
|
303
|
+
|
304
|
+
$src: "";
|
305
|
+
@each $ext in $extensions {
|
306
|
+
$i: index($extensions, $ext);
|
307
|
+
$src: #{$src + map-get($map, $ext)};
|
308
|
+
@if $i != length($extensions) {
|
309
|
+
$src: #{$src + ","};
|
310
|
+
}
|
311
|
+
}
|
312
|
+
|
313
|
+
@font-face {
|
314
|
+
font-family: $font-family;
|
315
|
+
@if(index($extensions, 'eot')) {
|
316
|
+
src: url('#{$source}.eot');
|
317
|
+
}
|
318
|
+
src: $src;
|
319
|
+
}
|
320
|
+
}
|
321
|
+
|
322
|
+
///
|
323
|
+
/// Opacity helper
|
324
|
+
///
|
325
|
+
/// @param {number} $value - Value of opacity must be between 0 and 1
|
326
|
+
///
|
327
|
+
/// @example scss
|
328
|
+
/// .box {
|
329
|
+
/// @include opacity(.3);
|
330
|
+
/// }
|
331
|
+
///
|
332
|
+
/// // CSS Output
|
333
|
+
/// .box {
|
334
|
+
/// opacity: 0.2;
|
335
|
+
/// filter: "alpha(opacity=20)";
|
336
|
+
/// }
|
337
|
+
///
|
338
|
+
@mixin opacity($value) {
|
339
|
+
$opacity-ie: $value * 100; // opacity on IE is between 0 and 100
|
340
|
+
opacity: $value;
|
341
|
+
filter: "alpha(opacity=#{$opacity-ie})";
|
342
|
+
}
|
343
|
+
|
344
|
+
///
|
345
|
+
/// Placeholder helper input element
|
346
|
+
///
|
347
|
+
/// @param {number} $selector - Pseudo element selector
|
348
|
+
///
|
349
|
+
/// @example scss
|
350
|
+
/// @include placeholder('.form-control') {
|
351
|
+
/// color: #DDDDDD;
|
352
|
+
/// }
|
353
|
+
///
|
354
|
+
/// // CSS Output
|
355
|
+
/// .form-control::-moz-placeholder {
|
356
|
+
/// color: #FFFFFF;
|
357
|
+
/// }
|
358
|
+
///
|
359
|
+
/// .form-control:-ms-input-placeholder {
|
360
|
+
/// color: #FFFFFF;
|
361
|
+
/// }
|
362
|
+
///
|
363
|
+
/// .form-control::-webkit-input-placeholder {
|
364
|
+
/// color: #FFFFFF;
|
365
|
+
/// }
|
366
|
+
///
|
367
|
+
@mixin placeholder($selector) {
|
368
|
+
#{$selector}::-moz-placeholder {
|
369
|
+
@content
|
370
|
+
}
|
371
|
+
#{$selector}:-ms-input-placeholder {
|
372
|
+
@content
|
373
|
+
}
|
374
|
+
#{$selector}::-webkit-input-placeholder {
|
375
|
+
@content
|
376
|
+
}
|
377
|
+
}
|
378
|
+
|
379
|
+
///
|
380
|
+
/// Box shadow helper
|
381
|
+
///
|
382
|
+
/// @param {number} $value
|
383
|
+
///
|
384
|
+
/// @example scss
|
385
|
+
/// .box {
|
386
|
+
/// @include box-shadow(0px 2px 4px rgba(0,0,0,.4));
|
387
|
+
/// }
|
388
|
+
///
|
389
|
+
/// // CSS Output
|
390
|
+
/// .box {
|
391
|
+
/// -webkit-box-shadow: 0px 2px 4px rgba(0,0,0,0.4);
|
392
|
+
/// -moz-box-shadow: 0px 2px 4px rgba(0,0,0,0.4);
|
393
|
+
/// box-shadow: 0px 2px 4px rgba(0,0,0,0.4);
|
394
|
+
/// }
|
395
|
+
///
|
396
|
+
@mixin box-shadow($value) {
|
397
|
+
-webkit-box-shadow: $value; // Chrome 4.0, Safari 3.1
|
398
|
+
-moz-box-shadow: $value; // Firefox 3.5
|
399
|
+
box-shadow: $value;
|
400
|
+
}
|
401
|
+
|
402
|
+
///
|
403
|
+
/// Box Sizing helper
|
404
|
+
///
|
405
|
+
/// @param {number} $value - box type
|
406
|
+
///
|
407
|
+
/// @example scss
|
408
|
+
/// *,
|
409
|
+
/// *:after,
|
410
|
+
/// *:before {
|
411
|
+
/// @include box-sizing(border-box);
|
412
|
+
/// }
|
413
|
+
///
|
414
|
+
/// // CSS Output
|
415
|
+
/// *,
|
416
|
+
/// *:after,
|
417
|
+
/// *:before {
|
418
|
+
/// -webkit-box-sizing: border-box;
|
419
|
+
/// -moz-box-sizing: border-box;
|
420
|
+
/// box-sizing: border-box;
|
421
|
+
/// }
|
422
|
+
///
|
423
|
+
@mixin box-sizing($value) {
|
424
|
+
-webkit-box-sizing: $value; // Chrome 4.0, Safari 3.2
|
425
|
+
-moz-box-sizing: $value; // Firefox 2.0
|
426
|
+
box-sizing: $value;
|
427
|
+
}
|
428
|
+
|
429
|
+
///
|
430
|
+
/// User select helper
|
431
|
+
///
|
432
|
+
/// @param {number} $value
|
433
|
+
///
|
434
|
+
/// @example scss
|
435
|
+
/// button {
|
436
|
+
/// @include user-select(none);
|
437
|
+
/// }
|
438
|
+
///
|
439
|
+
/// // CSS Output
|
440
|
+
/// button {
|
441
|
+
/// -webkit-user-select: none;
|
442
|
+
/// -moz-user-select: none;
|
443
|
+
/// -ms-user-select: none;
|
444
|
+
/// user-select: none;
|
445
|
+
/// }
|
446
|
+
///
|
447
|
+
@mixin user-select($value) {
|
448
|
+
-webkit-user-select: $value; // Chrome 6.0, Safari 3.1, Opera 15.0
|
449
|
+
-moz-user-select: $value; // Firefox 2.0
|
450
|
+
-ms-user-select: $value; // IE 10.0
|
451
|
+
user-select: $value;
|
452
|
+
}
|