$video-aspect: 16/10!default;
@mixin responsive-video($video-aspect){
position: relative;
&::before {
content: "";
display: block;
padding-bottom: 100% / ($video-aspect);
}
.responsive-video {
position: absolute;
z-index: 1;
width: 100%;
height: 100%;
top: 0;
left: 0;
}
}
.video-wrapper {
@include responsive-video($video-aspect);
}
SASS responsive video mixin
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.