Skip to content

Instantly share code, notes, and snippets.

@ovlb
Created January 14, 2019 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ovlb/4ac4945318a32ad66d0a05b8db6bd7ce to your computer and use it in GitHub Desktop.
Save ovlb/4ac4945318a32ad66d0a05b8db6bd7ce to your computer and use it in GitHub Desktop.
KS – Styles for the custom preview image
.video-container__image {
pointer-events: none;
transition: opacity 0.3s cubic-bezier(0, 0.1, 0.3, 1);
// Add play icon
&::after {
background-image: url('/images/icon_play_big.svg');
background-position: center;
// Play icon in large containers should be larger than in small ones
background-size: calc(45px + 5%);
background-repeat: no-repeat;
content: '';
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
z-index: 10;
}
& > img {
height: inherit;
left: inherit;
object-fit: cover;
position: inherit;
top: inherit;
width: inherit;
}
&--hidden {
opacity: 0;
& * {
pointer-events: none !important;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment