1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | $responsive-embed-margin-bottom: rem-calc(16) !default;
|
12 |
|
13 |
|
14 |
|
15 | $responsive-embed-ratios: (
|
16 | default: 4 by 3,
|
17 | widescreen: 16 by 9,
|
18 | ) !default;
|
19 |
|
20 |
|
21 | $responsive-embed-ratio: default;
|
22 |
|
23 |
|
24 |
|
25 | @mixin responsive-embed($ratio: default) {
|
26 | @if type-of($ratio) == 'string' {
|
27 | $ratio: map-get($responsive-embed-ratios, $ratio);
|
28 | }
|
29 | position: relative;
|
30 | height: 0;
|
31 | margin-bottom: $responsive-embed-margin-bottom;
|
32 | padding-bottom: ratio-to-percentage($ratio);
|
33 | overflow: hidden;
|
34 |
|
35 | iframe,
|
36 | object,
|
37 | embed,
|
38 | video {
|
39 | position: absolute;
|
40 | top: 0;
|
41 | #{$global-left}: 0;
|
42 | width: 100%;
|
43 | height: 100%;
|
44 | }
|
45 | }
|
46 |
|
47 | @mixin foundation-responsive-embed {
|
48 | .responsive-embed,
|
49 | .flex-video {
|
50 | @include responsive-embed($ratio: default);
|
51 |
|
52 | $ratios: map-remove($responsive-embed-ratios,default);
|
53 |
|
54 | @each $name, $ratio in $ratios {
|
55 | &.#{$name} {
|
56 | padding-bottom: ratio-to-percentage($ratio);
|
57 | }
|
58 | }
|
59 | }
|
60 | }
|
61 |
|
62 | @mixin foundation-flex-video {
|
63 | @warn 'This mixin is being replaced by foundation-responsive-embed(). foundation-flex-video() will be removed in Foundation 6.4.';
|
64 | @include foundation-responsive-embed;
|
65 | }
|
66 |
|
67 | @mixin flex-video($ratio: $responsive-embed-ratio) {
|
68 | @warn 'This mixin is being replaced by responsive-embed(). flex-video() will be removed in Foundation 6.4.';
|
69 | @include responsive-embed($ratio);
|
70 | }
|