//////////////////////// // Fluid Embeds and whatever WITH NO JAVASCIPT! //////////////////////// $intrinsic-ratio: 16/9 !default; $intrinsic-ratio-width: 100% !default; $intrinsic-ratio-elements: '> *' !default; $intrinsic-ratio-extend: true !default; $intrinsic-ratio-direction: top !default; @mixin intrinsic-ratio-parent($extend: $intrinsic-ratio-extend) { @if $extend { @extend %intrinsic-ratio-parent; } @else { position: relative; height: 0; } } @mixin intrinsic-ratio-child($extend: $intrinsic-ratio-extend) { @if $extend { @extend %intrinsic-ratio-child; } @else { display: block; position: absolute; width: 100% !important; // Nuke the external styles height: 100% !important; // Nuke the external styles top: 0; margin: 0; padding: 0; } } @mixin intrinsic-ratio-ratio($ratio: $intrinsic-ratio, $width: $intrinsic-ratio-width, $direction: $intrinsic-ratio-direction) { padding-#{$direction}: (1 / $ratio) * $width; } @mixin intrinsic-ratio($ratio: $intrinsic-ratio, $width: $intrinsic-ratio-width, $elements: $intrinsic-ratio-elements, $extend: $intrinsic-ratio-extend, $direction: $intrinsic-ratio-direction) { @include intrinsic-ratio-ratio($ratio, $width, $direction); width: $width; @each $element in $elements { #{$element} { @include intrinsic-ratio-child($extend); } } } @mixin ir($ratio: $intrinsic-ratio, $width: $intrinsic-ratio-width, $elements: $intrinsic-ratio-elements, $extend: $intrinsic-ratio-extend, $direction: $intrinsic-ratio-direction) { @include intrinsic-ratio($ratio, $width, $elements, $extend, $direction); } %intrinsic-ratio-parent { @include intrinsic-ratio-parent(false); } %intrinsic-ratio-child { @include intrinsic-ratio-child(false); }