Sha256: 80fab560e0853c48dd5dbc23c0ec29c1ce4bbcacfd1444dff579a5336bc2e92d

Contents?: true

Size: 1.24 KB

Versions: 6

Compression:

Stored size: 1.24 KB

Contents

////////////////////////
// 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 {
    position: relative;
    height: 0;
}

@mixin intrinsic-ratio-child {
  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: $intrinsic-ratio, $width: $intrinsic-ratio-width, $elements: $intrinsic-ratio-elements, $extend: $intrinsic-ratio-extend, $direction: $intrinsic-ratio-direction) {
  @if not $extend {
    @include intrinsic-ratio-parent;
  }
  @else {
    @extend %intrinsic-ratio-parent;
  }
  padding-#{$direction}: (1 / $ratio) * $width;
  width: $width;
  @each $element in $elements {
    #{$element} {
      @if not $extend {
	@include intrinsic-ratio-child;
      }
      @else {
	@extend %intrinsic-ratio-child;
      }
    }
  }
}

%intrinsic-ratio-parent {
  @include intrinsic-ratio-parent;
}

%intrinsic-ratio-child {
  @include intrinsic-ratio-child;
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
toolkit-1.0.0 stylesheets/toolkit/_intrinsic-ratio.scss
toolkit-0.3.1 stylesheets/toolkit/_intrinsic-ratio.scss
toolkit-0.3.0 stylesheets/toolkit/_intrinsic-ratio.scss
toolkit-0.2.8 stylesheets/toolkit/_intrinsic-ratio.scss
toolkit-0.2.7 stylesheets/toolkit/_intrinsic-ratio.scss
toolkit-0.2.6 stylesheets/toolkit/_intrinsic-ratio.scss