Skip to content

Instantly share code, notes, and snippets.

@pedrogpimenta
Created April 26, 2016 19:34
Show Gist options
  • Save pedrogpimenta/99c6fbe2854e5417822d5597118bcad9 to your computer and use it in GitHub Desktop.
Save pedrogpimenta/99c6fbe2854e5417822d5597118bcad9 to your computer and use it in GitHub Desktop.
MIXINS to create proportional elements // $proportion 4:3 = 75% (3/4*100) // http://www.smashingmagazine.com/2014/02/27/making-embedded-content-work-in-responsive-design/
=u-proportional-container($proportion: 75%, $boolean: true, $item: item)
position: relative
padding-bottom: $proportion
height: 0
overflow: hidden
@if $boolean
.#{$item}
position: absolute
top: 0
left: 0
width: 100%
height: 100%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment