Skip to content

Instantly share code, notes, and snippets.

@Shekey
Created August 13, 2019 11:31
Show Gist options
  • Save Shekey/95d54016f9663eed2a9c98de3e8b7042 to your computer and use it in GitHub Desktop.
Save Shekey/95d54016f9663eed2a9c98de3e8b7042 to your computer and use it in GitHub Desktop.
C3 logo rgb 72x72 c3 / vw_gm-website_magnolia
Search in this project
User activity
Project
Files
Commits
Network
Graphs
Milestones
Issues 0
Merge Requests 0
Labels
Wiki
vw_gm-website_magnolia hibiscus hibiscus-ui source _sass 00-generic _mixins.scss
validation fixes 3df3fd86
Mirza Pandzo authored 12 months ago Browse Code »
_mixins.scss 28.3 KB
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
/*! MIXINS ----------------------------------------------------------------------------- */
/*! Converts px to rems. Via David Ensinger: http://davidensinger.com/2013/03/using-rems-with-sass/
Usage: @include rem(font-size, 12px);
*/
@mixin rem($property, $values) {
// Create a couple of empty lists as output buffers.
$font-size: $font-size-base;
$px-values: ();
$rem-values: (); // Loop through the $values list
@each $value in $values {
// For each property value, if it's in rem or px, derive both rem and
// px values for it and add those to the end of the appropriate buffer.
// Ensure all pixel values are rounded to the nearest pixel.
@if $value == 0 or $value == 0px {
// 0 -- use it without a unit
$px-values: join($px-values, 0);
$rem-values: join($rem-values, 0);
}
@else if type-of($value) == number and not unitless($value) and (unit($value) == px) {
// px value given - calculate rem value from font-size
$new-rem-value: $value / $font-size;
$px-values: join($px-values, round($value));
$rem-values: join($rem-values, unquote('#{$new-rem-value}rem'));
}
@else if type-of($value) == number and not unitless($value) and (unit($value) == '%') {
// % value given - don't add px or rem
$px-values: join($px-values, #{$value});
$rem-values: join($rem-values, #{$value});
}
@else if $value == auto {
// auto - don't add px or rem
$px-values: join($px-values, auto);
$rem-values: join($rem-values, auto);
}
@else {
// unitless value - use those directly as rem and calculate the px-fallback
$px-values: join($px-values, round($value * $font-size));
$rem-values: join($rem-values, #{$value}rem);
}
} // output the converted rules
#{$property}: $px-values;
#{$property}: $rem-values;
}
/// toFixed() function in Sass
/// @author Hugo Giraudel
/// @param {Number} $float - Number to format
/// @param {Number} $digits [2] - Number of digits to leave
/// @return {Number}
@function to-fixed($float, $digits: 2) {
$sass-precision: 5;
@if $digits > $sass-precision {
@warn 'Sass sets default precision to #{$sass-precision} digits, and there is no way to change that for now.' + 'The returned number will have #{$sass-precision} digits, even if you asked for `#{$digits}`.' + 'See https://github.com/sass/sass/issues/1122 for further informations.';
}
$pow: pow(10, $digits);
@return round($float * $pow) / $pow;
}
/*! Stop float
Usage: @include tableclearfix;
*/
@mixin tableclearfix {
&::before,
&::after {
content: '';
display: table;
}
&::after {
clear: both;
}
}
// breakpoints ---------------------------------------------------------------------------
// use em here, since: http://zellwk.com/blog/media-query-units/
$breakpoints: ( // everything below tablet (768 - 1)
'small': '(max-width: #{pem($bp-small - 1)})', // tablet portrait (768+)
'medium': '(min-width: #{pem($bp-small)})', // mobile to tablet landscape ( - 1023)
'medium-max': '(max-width: #{pem($bp-medium - 1)})', // tablet portrait only (768 - 1023)
'medium-only': '(min-width: #{pem($bp-small)}) and (max-width: #{pem($bp-medium - 1)})', // tablet landscape and bigger (1024+)
'large': '(min-width: #{pem($bp-medium)})', // tablet landscape only ( 1024 - 1439)
'large-only': '(min-width: #{pem($bp-medium)}) and (max-width: #{pem($bp-large - 1)})', // mobile to desktop small ( - 1439)
'large-max': '(max-width: #{pem($bp-large - 1)})', // desktop small and bigger (1440+)
'xlarge': '(min-width: #{pem($bp-large)})'
) !default;
/// Mixin to manage responsive breakpoints
/// @author Hugo Giraudel
/// @param {String} $breakpoint - Breakpoint name
/// @require $breakpoints
@mixin bp($breakpoint) {
// If the key exists in the map
@if map-has-key($breakpoints, $breakpoint) {
// Prints a media query based on the value
@media #{map-get($breakpoints, $breakpoint)} {
@content;
}
}
@else {
// If the key doesn't exist in the map
@warn 'Unfortunately, no value could be retrieved from `#{$breakpoint}`. ' + 'Available breakpoints are: #{map-keys($breakpoints)}.';
}
}
/// Creates a visual triangle.
/// Mixin takes ($size, $color, $direction)
/// The $size argument can take one or two values—width height.
/// The $color argument can take one or two
/// values—foreground-color background-color.
///
/// @author http://bourbon.io/docs/#triangle
///
/// $direction:
/// up, down, left, right, up-right, up-left, down-right, down-left
/// @example scss - Usage
/// @include triangle(12px, gray, down);
/// @include triangle(12px 6px, gray blue, up-left);
///
@mixin triangle($size, $color, $direction) {
$width: nth($size, 1);
$height: nth($size, length($size));
$foreground-color: nth($color, 1);
$background-color: if(length($color) == 2, nth($color, 2), transparent);
height: 0;
width: 0;
@if ($direction == up) or ($direction == down) or ($direction == right) or ($direction == left) {
$width: $width / 2;
$height: if(length($size) > 1, $height, $height/2);
@if $direction == up {
border-bottom: $height solid $foreground-color;
border-left: $width solid $background-color;
border-right: $width solid $background-color;
}
@else if $direction == right {
border-bottom: $width solid $background-color;
border-left: $height solid $foreground-color;
border-top: $width solid $background-color;
}
@else if $direction == down {
border-left: $width solid $background-color;
border-right: $width solid $background-color;
border-top: $height solid $foreground-color;
}
@else if $direction == left {
border-bottom: $width solid $background-color;
border-right: $height solid $foreground-color;
border-top: $width solid $background-color;
}
}
@else if ($direction == up-right) or ($direction == up-left) {
border-top: $height solid $foreground-color;
@if $direction == up-right {
border-left: $width solid $background-color;
}
@else if $direction == up-left {
border-right: $width solid $background-color;
}
}
@else if ($direction == down-right) or ($direction == down-left) {
border-bottom: $height solid $foreground-color;
@if $direction == down-right {
border-left: $width solid $background-color;
}
@else if $direction == down-left {
border-right: $width solid $background-color;
}
}
@else if ($direction == inset-up) {
border-color: $background-color $background-color $foreground-color;
border-style: solid;
border-width: $height $width;
}
@else if ($direction == inset-down) {
border-color: $foreground-color $background-color $background-color;
border-style: solid;
border-width: $height $width;
}
@else if ($direction == inset-right) {
border-color: $background-color $background-color $background-color $foreground-color;
border-style: solid;
border-width: $width $height;
}
@else if ($direction == inset-left) {
border-color: $background-color $foreground-color $background-color $background-color;
border-style: solid;
border-width: $width $height;
}
}
// icons ---------------------------------------------------------------------------
@mixin icon($icon-name, $icon-color: $color--white) {
background-repeat: no-repeat;
background-position: center center;
background-size: contain;
@if $icon-name == arrow-right-small {
background-image: inline-svg('<svg xmlns="http://www.w3.org/2000/svg" width="6px" height="11px" viewBox="0 0 6 11"><path fill="#{$icon-color}" fill-rule="evenodd" d="M0 .9c0 .1 0 .2.1.3l4.1 4.3L.1 9.8c-.1.1-.1.2-.1.3 0 .1 0 .2.1.3l.5.6h.3c.1 0 .1 0 .2-.1l4.8-5.1c.1-.1.1-.2.1-.3s0-.2-.1-.3L1.1.1C1 0 .9 0 .9 0 .8 0 .7 0 .6.1L.1.7C0 .7 0 .8 0 .9z"/></svg>');
}
@else if $icon-name == arrow-left-small {
background-image: inline-svg('<svg xmlns="http://www.w3.org/2000/svg" width="6px" height="11px" viewBox="0 0 6 11"><path fill="#{$icon-color}" fill-rule="evenodd" d="M6 10.1c0-.1 0-.2-.1-.3L1.8 5.5l4.1-4.3C6 1.1 6 1 6 .9c0-.1 0-.2-.1-.3L5.4.1C5.3 0 5.2 0 5.1 0 5 0 5 0 4.9.1L.1 5.2c-.1.1-.1.2-.1.3 0 .1 0 .2.1.3l4.8 5.1c.1.1.2.1.2.1.1 0 .2 0 .2-.1l.5-.6c.2 0 .2-.1.2-.2z"/></svg>');
}
@else if $icon-name == arrow-right-big {
background-image: inline-svg('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><polygon stroke="none" fill="#{$icon-color}" fill-rule="evenodd" transform="translate(-35, -35)" points="64.78 42 64.834 45.056 76.229 58.056 39 58.056 39 60.056 76.228 60.056 65.001 73.139 65.001 76.056 79.876 58.969"></polygon></svg>');
}
@else if $icon-name == arrow-left-big {
background-image: inline-svg('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><polygon stroke="none" fill="#{$icon-color}" fill-rule="evenodd" transform="translate(25 24) rotate(-180.000000) translate(-1305.437500, 5825.972000) " points="1310.78 -5843 1310.834 -5839.944 1322.229 -5826.944 1285 -5826.944 1285 -5824.944 1322.228 -5824.944 1311.001 -5811.861 1311.001 -5808.944 1325.876 -5826.031"></polygon></svg>');
}
@else if $icon-name == arrow-up-big {
background-image: inline-svg('<svg xmlns="http://www.w3.org/2000/svg" width="35px" height="42px" viewBox="42 38 35 42" xmlns:xlink="http://www.w3.org/1999/xlink"><polygon stroke="none" fill="#{$icon-color}" fill-rule="evenodd" transform="translate(59.437500, 59.027500) rotate(-90.000000) translate(-59.437500, -59.027500) " points="64.7795 41.9995 64.8335 45.0555 76.2285 58.0555 38.9995 58.0555 38.9995 60.0555 76.2275 60.0555 65.0005 73.1385 65.0005 76.0555 79.8755 58.9685"></polygon></svg>');
}
@else if $icon-name == arrow-down {
background-image: inline-svg('<svg xmlns="http://www.w3.org/2000/svg" width="11px" height="6px" viewBox="0 0 11 6"><path fill="#{$icon-color}" fill-rule="evenodd" d="M10.1 0c-.1 0-.2 0-.3.1L5.5 4.2 1.2.1C1.1 0 1 0 .9 0 .8 0 .7 0 .7.1L.1.6C0 .7 0 .8 0 .9c0 .1 0 .1.1.2l5.1 4.8c.1.1.2.1.3.1s.2 0 .3-.1l5.1-4.8c.1-.1.1-.2.1-.2 0-.1 0-.2-.1-.2l-.6-.5c0-.2-.1-.2-.2-.2z"/></svg>');
}
@else if $icon-name == arrow-up {
background-image: inline-svg('<svg xmlns="http://www.w3.org/2000/svg" width="11px" height="6px" viewBox="0 0 11 6"><path fill="#{$icon-color}" fill-rule="evenodd" d="M.9 6c.1 0 .2 0 .3-.1l4.3-4.1 4.3 4.1c.1.1.2.1.3.1.1 0 .2 0 .3-.1l.6-.5v-.3c0-.1 0-.1-.1-.2L5.8.1C5.7 0 5.6 0 5.5 0s-.2 0-.3.1L.1 4.9c-.1.1-.1.2-.1.2 0 .1 0 .2.1.2l.6.5c0 .2.1.2.2.2z"/></svg>');
}
@else if $icon-name == menu-more {
background-image: inline-svg('<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" viewBox="0 0 16.3 16.3"><path fill="#{$icon-color}" fill-rule="evenodd" d="M7.9 16.2c.1.1.2.1.3.1.2 0 .4-.2.4-.4V8.5H16c.2 0 .4-.2.4-.4s-.2-.4-.4-.4H8.6V.4C8.5.2 8.4 0 8.1 0c-.2 0-.4.2-.4.4v7.4H.3c-.1-.1-.3.1-.3.3 0 .1 0 .2.1.3s.2.1.3.1h7.4v7.4c-.1.1 0 .2.1.3z"/></svg>');
}
@else if $icon-name == magnifier {
background-image: inline-svg('<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15"><path fill="#{$icon-color}" fill-rule="evenodd" d="M14.77 13.66l-3.7-3.7c.95-1.1 1.48-2.47 1.48-3.9C12.55 2.72 9.73 0 6.27 0 2.8 0 0 2.72 0 6.06 0 9.4 2.8 12.1 6.27 12.1c1.3 0 2.54-.37 3.6-1.08l3.72 3.74c.12.15.33.24.55.24.2 0 .42-.08.57-.22.32-.3.33-.8.02-1.12zM6.27 1.58c2.56 0 4.64 2 4.64 4.48 0 2.46-2.04 4.47-4.6 4.47-2.55 0-4.63-2-4.63-4.47 0-2.47 2.08-4.48 4.63-4.48z"/></svg>');
}
@else if $icon-name == search {
background-image: inline-svg('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 40 40"><path fill="#{$icon-color}" fill-rule="evenodd" d="M16.3645356,26.0202407 L4.82842712,37.5563492 L2,34.7279221 L13.5998085,23.1281135 C11.9630433,20.8365541 11,18.0307424 11,15 C11,7.2680135 17.2680135,1 25,1 C32.7319865,1 39,7.2680135 39,15 C39,22.7319865 32.7319865,29 25,29 C21.7417007,29 18.7433772,27.8869115 16.3645356,26.0202407 Z M25,25 C30.5228475,25 35,20.5228475 35,15 C35,9.4771525 30.5228475,5 25,5 C19.4771525,5 15,9.4771525 15,15 C15,20.5228475 19.4771525,25 25,25 Z"></path></svg>');
}
@else if $icon-name == search-mirror {
background-image: inline-svg('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 25"><path fill="none" stroke="#{$icon-color}" stroke-width="2" stroke-linecap="round" d="M10.22 14.8l-9.03 9.01"/><ellipse fill="none" stroke="#{$icon-color}" stroke-width="2" cx="16.04" cy="9.13" rx="7.91" ry="8.13"/></svg>');
}
@else if $icon-name == cross {
background-image: inline-svg('<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M57.363961,58.7781746 L51,65.1421356 L52.4142136,66.5563492 L58.7781746,60.1923882 L65.1421356,66.5563492 L66.5563492,65.1421356 L60.1923882,58.7781746 L66.5563492,52.4142136 L65.1421356,51 L58.7781746,57.363961 L52.4142136,51 L51,52.4142136 L57.363961,58.7781746 Z" stroke="none" fill="#{$icon-color}" fill-rule="evenodd"/></svg>');
}
@else if $icon-name == 'close' {
background-image: inline-svg('<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" fill="#{$icon-color}"><path d="M16.4,15l6.4-6.4c0.4-0.4,0.4-1,0-1.4c-0.4-0.4-1-0.4-1.4,0L15,13.6L8.6,7.2c-0.4-0.4-1-0.4-1.4,0c-0.4,0.4-0.4,1,0,1.4l6.4,6.4l-6.4,6.4c-0.4,0.4-0.4,1,0,1.4c0.4,0.4,1,0.4,1.4,0l6.4-6.4l6.4,6.4c0.4,0.4,1,0.4,1.4,0c0.4-0.4,0.4-1,0-1.4L16.4,15z"/></svg>');
}
@else if $icon-name == 'quote' {
background-image: inline-svg('<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 90 80" fill="#{$icon-color}"><path d="M44.0825,40.32 L44.0825,42.48 L15.1025,81.9 L0.162499997,73.08 L19.4225,41.22 L-0.017500003,9.54 L15.1025,0.9 L44.0825,40.32 Z M83.8625,40.32 L83.8625,42.48 L54.8825,81.9 L39.9425,73.08 L59.2025,41.22 L39.7625,9.54 L54.8825,0.9 L83.8625,40.32 Z" stroke="none" fill="#{$icon-color}" fill-rule="evenodd"></path></svg>');
}
@else if $icon-name == 'link-more' {
background-image: inline-svg('<svg class="" viewBox="0 0 24 34" xmlns="http://www.w3.org/2000/svg" fill="#{$icon-color}"><path d="M7.04850554,33.5651807 L22.5682109,18.0254612 C22.8488244,17.7444858 22.987155,17.3784264 22.9950596,17.0113775 L23,17.0113775 C23,17.0074201 22.9980238,17.0034627 22.9980238,17.0004947 C22.9980238,16.9965373 23,16.9925799 23,16.9886225 L22.9950596,16.9886225 C22.987155,16.6215736 22.8488244,16.2555142 22.5682109,15.9745388 L7.04850554,0.434819298 C6.46949316,-0.144939766 5.53082123,-0.144939766 4.95279693,0.434819298 L1.43425928,3.95789443 C0.855246907,4.53765349 0.855246907,5.47753594 1.43425928,6.05630565 L12.3633648,17.0004947 L1.43425928,27.9436943 C0.855246907,28.5234534 0.855246907,29.4623465 1.43425928,30.0421056 L4.95279693,33.5651807 C5.53082123,34.1449398 6.46949316,34.1449398 7.04850554,33.5651807" fill="#{$icon-color}" fill-rule="evenodd"></path></svg>');
}
@else if $icon-name == 'calendar' {
background-image: inline-svg('<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 49 50" fill="#{$icon-color}"><path d="M32.363,29.012 L41.241,29.012 L41.241,19.954 L32.363,19.954 L32.363,29.012 Z M32.363,41.07 L41.241,41.07 L41.241,32.012 L32.363,32.012 L32.363,41.07 Z M20.486,29.012 L29.363,29.012 L29.363,19.954 L20.486,19.954 L20.486,29.012 Z M20.486,41.07 L29.363,41.07 L29.363,32.012 L20.486,32.012 L20.486,41.07 Z M8.608,29.012 L17.486,29.012 L17.486,19.954 L8.608,19.954 L8.608,29.012 Z M8.608,41.07 L17.486,41.07 L17.486,32.012 L8.608,32.012 L8.608,41.07 Z M43.35,8.213 L49.234,8.213 L49.234,47.2 L0.615,47.2 L0.615,8.213 L6.498,8.213 L6.498,8.911 C6.498,11.721 8.784,14.007 11.594,14.007 C14.405,14.007 16.691,11.721 16.691,8.911 L16.691,8.213 L19.827,8.213 L19.827,8.911 C19.827,11.721 22.113,14.007 24.924,14.007 C27.735,14.007 30.021,11.721 30.021,8.911 L30.021,8.213 L33.157,8.213 L33.157,8.911 C33.157,11.721 35.443,14.007 38.254,14.007 C41.064,14.007 43.35,11.721 43.35,8.911 L43.35,8.213 Z M11.5944,11.0072 C10.4944,11.0072 9.5944,10.0642 9.5944,8.9112 L9.5944,2.5972 C9.5944,1.4442 10.4944,0.5012 11.5944,0.5012 C12.6944,0.5012 13.5944,1.4442 13.5944,2.5972 L13.5944,8.9112 C13.5944,10.0642 12.6944,11.0072 11.5944,11.0072 Z M24.924,11.0072 C23.824,11.0072 22.924,10.0642 22.924,8.9112 L22.924,2.5972 C22.924,1.4442 23.824,0.5012 24.924,0.5012 C26.024,0.5012 26.924,1.4442 26.924,2.5972 L26.924,8.9112 C26.924,10.0642 26.024,11.0072 24.924,11.0072 Z M38.2536,11.0072 C37.1536,11.0072 36.2536,10.0642 36.2536,8.9112 L36.2536,2.5972 C36.2536,1.4442 37.1536,0.5012 38.2536,0.5012 C39.3536,0.5012 40.2536,1.4442 40.2536,2.5972 L40.2536,8.9112 C40.2536,10.0642 39.3536,11.0072 38.2536,11.0072 Z" stroke="none" fill="#{$icon-color}" fill-rule="evenodd"></path></svg>');
}
@else if $icon-name == 'checkbox' {
background-image: inline-svg('<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 30 30" fill="#{$icon-color}"><path d="M22.793811,7.08030885 C22.6416721,6.95867032 22.419818,6.97718843 22.2901912,7.12242846 L12.5358709,18.0633599 L7.52908396,14.9672055 C7.37512953,14.8720733 7.17397209,14.9029368 7.05632766,15.0398256 L6.08721357,16.1694299 C5.95359274,16.3251998 5.97610495,16.5593994 6.13695828,16.6875737 L12.6981766,21.9198457 C12.855762,22.0454784 13.0863306,22.0207876 13.2126894,21.8642914 L24.0218155,8.52617334 C24.1485374,8.36967721 24.1234835,8.14128726 23.9658981,8.01565464 L22.793811,7.08030885 Z" stroke="none" fill="#{$icon-color}" fill-rule="evenodd"></path></svg>');
}
@else if $icon-name == arrow-left-calendar {
background-image: inline-svg('<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="12px" viewBox="0 0 8 12"><path fill="#{$icon-color}" d="M0.393966667,5.67764571 C0.2993,5.77501714 0.252633333,5.90187429 0.249966667,6.02907429 C0.252633333,6.16416 0.2993,6.29101714 0.393966667,6.38838857 L5.62963333,11.7736457 C5.82496667,11.97456 6.14163333,11.97456 6.33663333,11.7736457 L7.52363333,10.5527314 C7.71896667,10.3518171 7.71896667,10.0261029 7.52363333,9.82553143 L3.83663333,6.03284571 L7.52363333,2.24050286 C7.71896667,2.03958857 7.71896667,1.71421714 7.52363333,1.51330286 L6.33663333,0.292388571 C6.14163333,0.0914742857 5.82496667,0.0914742857 5.62963333,0.292388571 L0.393966667,5.67764571 Z" fill-rule="evenodd" /></svg>');
}
@else if $icon-name == arrow-right-calendar {
background-image: inline-svg('<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="12px" viewBox="0 0 8 12"><path fill="#{$icon-color}" d="M0.393966667,5.67764571 C0.2993,5.77501714 0.252633333,5.90187429 0.249966667,6.02907429 C0.252633333,6.16416 0.2993,6.29101714 0.393966667,6.38838857 L5.62963333,11.7736457 C5.82496667,11.97456 6.14163333,11.97456 6.33663333,11.7736457 L7.52363333,10.5527314 C7.71896667,10.3518171 7.71896667,10.0261029 7.52363333,9.82553143 L3.83663333,6.03284571 L7.52363333,2.24050286 C7.71896667,2.03958857 7.71896667,1.71421714 7.52363333,1.51330286 L6.33663333,0.292388571 C6.14163333,0.0914742857 5.82496667,0.0914742857 5.62963333,0.292388571 L0.393966667,5.67764571 Z" fill-rule="evenodd" /></svg>');
}
@else if $icon-name == 'checkbox-success' {
background-image: inline-svg('<svg xmlns="http://www.w3.org/2000/svg" width="19" height="15" viewBox="0 5 25 18" fill="#{$icon-color}"><path d="M22.793811,7.08030885 C22.6416721,6.95867032 22.419818,6.97718843 22.2901912,7.12242846 L12.5358709,18.0633599 L7.52908396,14.9672055 C7.37512953,14.8720733 7.17397209,14.9029368 7.05632766,15.0398256 L6.08721357,16.1694299 C5.95359274,16.3251998 5.97610495,16.5593994 6.13695828,16.6875737 L12.6981766,21.9198457 C12.855762,22.0454784 13.0863306,22.0207876 13.2126894,21.8642914 L24.0218155,8.52617334 C24.1485374,8.36967721 24.1234835,8.14128726 23.9658981,8.01565464 L22.793811,7.08030885 Z" stroke="none" fill="#{$icon-color}" fill-rule="evenodd"></path></svg>');
}
}
// svg ---------------------------------------------------------------------------
/*! give colors to all svg icons depending on set icon class */
@each $svg-color in $svg-colors {
svg.#{nth($svg-color, 1)},
.#{nth($svg-color, 1)} {
path {
fill: nth($svg-color, 2);
}
svg {
fill: nth($svg-color, 2);
}
}
}
/*! usage
.selector-1 {
@include linear-gradient(#31B7D7, #EDAC7D);
}
.selector-2 {
@include linear-gradient(to right, #E47D7D 0%, #C195D3 50%, #4FB4E8 100%);
}
.selector-3 {
@include linear-gradient(42deg, #B58234 0%, #D2B545 50%, #D7C04D 50.01%, #FFFFFF 100%);
}
*/
@mixin linear-gradient($direction, $color-stops...) {
// Direction has been omitted and happens to be a color-stop
@if is-direction($direction) == false {
$color-stops: $direction, $color-stops;
$direction: 180deg;
}
background: nth(nth($color-stops, 1), 1);
background: -webkit-linear-gradient(legacy-direction($direction), $color-stops);
background: linear-gradient($direction, $color-stops);
}
@mixin arrow-hover () {
.icon-arrow-long-right {
transition: margin-left padding-right;
transition-duration: 300ms;
transform-style: ease-out;
margin-left: 5px;
padding-right: 10px;
display: inline;
@include bp(large) {
display: inline-block;
}
}
&:hover {
.icon-arrow-long-right {
margin-left: 10px;
width: 12px;
padding-right: 0;
}
}
}
@mixin button-hover-state {
color: $color--white;
background-color: $color--button-filled-bg;
&:hover {
background-color: $color--vwtb-blue-darkest;
border-color: $color--vwtb-blue-darkest;
}
&:active {
background-color: $color--black;
border-color: $color--black;
}
}
@mixin input-placeholder($color, $font-weight) {
&::-webkit-input-placeholder {
color: $color;
font-weight: $font-weight;
}
&:-moz-placeholder {
/*! Firefox 18- */
color: $color;
font-weight: $font-weight;
}
&::-moz-placeholder {
/*! Firefox 19+ */
color: $color;
font-weight: $font-weight;
}
&:-ms-input-placeholder {
color: $color;
font-weight: $font-weight;
}
}
@mixin input-focus-state {
&:focus {
@include f-sans-bold;
}
}
@mixin icon-hover-state {
svg {
transition: transform 300ms;
transform: scale(1);
}
&:hover {
svg {
transform: scale(1.3);
}
}
}
@mixin flex-center-items() {
-webkit-align-items: center;
/*! Safari 7.0+ */
-webkit-flex-align: center;
align-items: center;
-webkit-justify-content: center;
justify-content: center;
}
@mixin flex-order($order) {
order: $order;
-webkit-order: $order;
-ms-flex-order: $order;
}
@mixin display-flex-row() {
display: -moz-flex;
display: -ms-flexbox;
display: -ms-flex;
display: -webkit-flex;
display: flex;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
}
@mixin opacity($value) {
$ievalue: $value * 100;
opacity: $value;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=" + $ievalue + ")";
filter: alpha(opacity=$ievalue);
}
@mixin display-flex-column() {
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-ms-flex: 0 1 auto;
-webkit-flex: 0 1 auto;
flex: 0 1 auto;
}
@mixin button-line-animation ($stroke, $color, $keyframe-animation: false) {
border: 0;
&:hover {
&::before {
//right border
transition: height 200ms 600ms;
height: 100%;
}
&::after {
//top border
transition: width 200ms 600ms;
width: 100%;
}
.outer {
&::after {
//bottom border
@if $keyframe-animation == true {
animation: animationline 500ms;
}
@if $keyframe-animation == false {
transition: width 500ms;
}
width: 100%;
}
&::before {
//left border
@if $keyframe-animation == true {
transition: height 100ms 500ms;
}
@if $keyframe-animation == false {
transition: height 500ms;
}
height: 100%;
}
}
}
&::before,
&::after,
.outer::before,
.outer::after {
content: '';
position: absolute;
display: block;
background-color: $color;
}
&::before,
.outer::before {
height: 0;
width: #{$stroke}px;
bottom: 0;
}
&::after,
.outer::after {
left: 0;
height: #{$stroke}px;
}
&::before {
transition: height 100ms;
opacity: 1;
right: 0;
left: auto;
top: auto;
}
&::after {
top: 0;
width: 0;
}
.outer {
&::before {
left: 0;
transition: height 100ms;
}
&::after {
@if $keyframe-animation == true {
width: calc(100% - 10px);
}
@if $keyframe-animation == false {
width: 0;
}
transform-origin: center;
transform: scaleX(1);
bottom: 0;
}
}
}
// Flexbox Mixins
@mixin flexbox {
display: -webkit-box;
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
}
%flexbox { @include flexbox; }
@mixin inline-flex {
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -moz-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
}
%inline-flex { @include inline-flex; }
@mixin flex-direction($value: row) {
@if $value == row-reverse {
-webkit-box-direction: reverse;
-webkit-box-orient: horizontal;
} @else if $value == column {
-webkit-box-direction: normal;
-webkit-box-orient: vertical;
} @else if $value == column-reverse {
-webkit-box-direction: reverse;
-webkit-box-orient: vertical;
} @else {
-webkit-box-direction: normal;
-webkit-box-orient: horizontal;
}
-webkit-flex-direction: $value;
-ms-flex-direction: $value;
flex-direction: $value;
}
@mixin flex-dir($args...) { @include flex-direction($args...); }
@mixin flex-wrap($value: nowrap) {
-webkit-flex-wrap: $value;
@if $value == nowrap {
-ms-flex-wrap: none;
} @else {
-ms-flex-wrap: $value;
}
flex-wrap: $value;
}
@mixin flex-flow($values: (row nowrap)) {
// No Webkit Box fallback.
-webkit-flex-flow: $values;
-ms-flex-flow: $values;
flex-flow: $values;
}
@mixin order($int: 0) {
-webkit-box-ordinal-group: $int + 1;
-webkit-order: $int;
-ms-flex-order: $int;
order: $int;
}
@mixin flex-grow($int: 0) {
-webkit-box-flex: $int;
-webkit-flex-grow: $int;
-ms-flex-positive: $int;
flex-grow: $int;
}
@mixin flex-shrink($int: 1) {
-webkit-flex-shrink: $int;
-ms-flex-negative: $int;
flex-shrink: $int;
}
@mixin flex-basis($value: auto) {
-webkit-flex-basis: $value;
-ms-flex-preferred-size: $value;
flex-basis: $value;
}
@mixin flex($fg: 1, $fs: null, $fb: null) {
// Set a variable to be used by box-flex properties
$fg-boxflex: $fg;
// Box-Flex only supports a flex-grow value so let's grab the
// first item in the list and just return that.
@if type-of($fg) == 'list' {
$fg-boxflex: nth($fg, 1);
}
-webkit-box-flex: $fg-boxflex;
-webkit-flex: $fg $fs $fb;
-moz-box-flex: $fg-boxflex;
-ms-flex: $fg $fs $fb;
flex: $fg $fs $fb;
}
@mixin justify-content($value: flex-start) {
@if $value == flex-start {
-webkit-box-pack: start;
-ms-flex-pack: start;
} @else if $value == flex-end {
-webkit-box-pack: end;
-ms-flex-pack: end;
} @else if $value == space-between {
-webkit-box-pack: justify;
-ms-flex-pack: justify;
} @else if $value == space-around {
-ms-flex-pack: distribute;
} @else {
-webkit-box-pack: $value;
-ms-flex-pack: $value;
}
-webkit-justify-content: $value;
justify-content: $value;
}
// Shorter version:
@mixin flex-just($args...) { @include justify-content($args...); }
@mixin align-items($value: stretch) {
@if $value == flex-start {
-webkit-box-align: start;
-ms-flex-align: start;
} @else if $value == flex-end {
-webkit-box-align: end;
-ms-flex-align: end;
} @else {
-webkit-box-align: $value;
-ms-flex-align: $value;
}
-webkit-align-items: $value;
align-items: $value;
}
@mixin align-self($value: auto) {
// No Webkit Box Fallback.
-webkit-align-self: $value;
@if $value == flex-start {
-ms-flex-item-align: start;
} @else if $value == flex-end {
-ms-flex-item-align: end;
} @else {
-ms-flex-item-align: $value;
}
align-self: $value;
}
@mixin align-content($value: stretch) {
// No Webkit Box Fallback.
-webkit-align-content: $value;
@if $value == flex-start {
-ms-flex-line-pack: start;
} @else if $value == flex-end {
-ms-flex-line-pack: end;
} @else {
-ms-flex-line-pack: $value;
}
align-content: $value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment