Skip to content

Instantly share code, notes, and snippets.

@itumulak
Created November 3, 2017 19:39
Show Gist options
  • Select an option

  • Save itumulak/07bd0482702dcf546eef50f9e7fd8028 to your computer and use it in GitHub Desktop.

Select an option

Save itumulak/07bd0482702dcf546eef50f9e7fd8028 to your computer and use it in GitHub Desktop.
// Best added in :before or :after
@mixin img_overlay($width, $height, $url : '../img/video-player.png' ) {
background-image: url($url);
max-width: #{$width}px;
max-height: #{$height}px;
content: ' ';
display: block;
width: 100%;
position: absolute;
height: 100%;
top: calc(50% - #{$height}px + (#{$height}px / 2) );
background-repeat: no-repeat;
left: calc(50% - #{$width}px + (#{$width}px / 2) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment