Sha256: fba9eaaacb25bea30d8d21aad04176879a0df381a13bc0899405cecd05918e48

Contents?: true

Size: 1.69 KB

Versions: 45

Compression:

Stored size: 1.69 KB

Contents

// **************************************
//
//   #tools.intrinsic-ratio
//   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

=intrinsic-ratio-parent($extend: $intrinsic-ratio-extend)
  @if $extend
    @extend %intrinsic-ratio-parent
  @else
    position: relative
    height: 0

=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

=intrinsic-ratio-ratio($ratio: $intrinsic-ratio, $width: $intrinsic-ratio-width, $direction: $intrinsic-ratio-direction)
  padding-#{$direction}: 1 / $ratio * $width
  width: $width

=intrinsic-ratio($ratio: $intrinsic-ratio, $width: $intrinsic-ratio-width, $elements: $intrinsic-ratio-elements, $extend: $intrinsic-ratio-extend, $direction: $intrinsic-ratio-direction)
  +intrinsic-ratio-parent($extend)
  +intrinsic-ratio-ratio($ratio, $width, $direction)
  @each $element in $elements
    #{$element}
      +intrinsic-ratio-child($extend)

=ir($ratio: $intrinsic-ratio, $width: $intrinsic-ratio-width, $elements: $intrinsic-ratio-elements, $extend: $intrinsic-ratio-extend, $direction: $intrinsic-ratio-direction)
  +intrinsic-ratio($ratio, $width, $elements, $extend, $direction)

%intrinsic-ratio-parent
  +intrinsic-ratio-parent(false)

%intrinsic-ratio-child
  +intrinsic-ratio-child(false)

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
wrgem-0.0.50 lib/generators/wrstart/template/stylesheets/tools/_tools.intrinsic-ratio.sass
wrgem-0.0.49 lib/generators/wrstart/template/stylesheets/tools/_tools.intrinsic-ratio.sass
wrgem-0.0.48 lib/generators/wrstart/template/stylesheets/tools/_tools.intrinsic-ratio.sass
wrgem-0.0.47 lib/generators/wrstart/template/stylesheets/tools/_tools.intrinsic-ratio.sass
wrgem-0.0.46 lib/generators/wrstart/template/stylesheets/tools/_tools.intrinsic-ratio.sass
wrgem-0.0.45 lib/generators/wrstart/template/stylesheets/tools/_tools.intrinsic-ratio.sass
wrgem-0.0.44 lib/generators/wrstart/template/stylesheets/tools/_tools.intrinsic-ratio.sass
wrgem-0.0.43 lib/generators/wrstart/template/stylesheets/tools/_tools.intrinsic-ratio.sass
wrgem-0.0.42 lib/generators/wrstart/template/stylesheets/tools/_tools.intrinsic-ratio.sass
wrgem-0.0.41 lib/generators/wrstart/template/stylesheets/tools/_tools.intrinsic-ratio.sass
wrgem-0.0.40 lib/generators/wrstart/template/stylesheets/tools/_tools.intrinsic-ratio.sass
wrgem-0.0.39 lib/generators/wrstart/template/stylesheets/tools/_tools.intrinsic-ratio.sass
wrgem-0.0.38 lib/generators/wrstart/template/stylesheets/tools/_tools.intrinsic-ratio.sass
wrgem-0.0.37 lib/generators/wrstart/template/stylesheets/tools/_tools.intrinsic-ratio.sass
wrgem-0.0.35 lib/generators/wrstart/template/stylesheets/tools/_tools.intrinsic-ratio.sass
wrgem-0.0.32 lib/generators/wrstart/template/stylesheets/tools/_tools.intrinsic-ratio.sass
wrgem-0.0.31 lib/generators/wrstart/template/stylesheets/tools/_tools.intrinsic-ratio.sass
wrgem-0.0.30 lib/generators/wrstart/template/stylesheets/tools/_tools.intrinsic-ratio.sass
wrgem-0.0.29 lib/generators/wrstart/template/stylesheets/tools/_tools.intrinsic-ratio.sass
wrgem-0.0.28 lib/generators/wrstart/template/stylesheets/tools/_tools.intrinsic-ratio.sass