Skip to content

Instantly share code, notes, and snippets.

@githiro
Last active August 29, 2015 14:13
Show Gist options
  • Save githiro/f6f08a0375042d307323 to your computer and use it in GitHub Desktop.
Save githiro/f6f08a0375042d307323 to your computer and use it in GitHub Desktop.
SASS: Flexible video snippet.
// Flexible video
////////////////////////////////////
$flex-video-classname: "flex-video" !default;
$flex-video-fallback-max-width: 490px !default;
.#{$flex-video-classname} {
position: relative;
height: 0;
max-width: 100%;
margin-bottom: 1.6em !important;
padding: 0 0 61%;
.oldie & {
margin: 15px 0;
max-width: $flex-video-fallback-max-width;
}
iframe, object, embed, video {
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