Created
January 14, 2019 19:46
-
-
Save ovlb/4ac4945318a32ad66d0a05b8db6bd7ce to your computer and use it in GitHub Desktop.
KS – Styles for the custom preview image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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