Created
August 24, 2015 10:27
-
-
Save mattradford/4eaec9b28d187ab4e925 to your computer and use it in GitHub Desktop.
Transition on a psuedo element background
This file contains hidden or 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
article { | |
.featured-image { | |
position: relative; | |
&:before { | |
.transition(all 0.3s ease); | |
position: absolute; | |
top: 0; | |
left: 0; | |
right: 0; | |
bottom: 0; | |
z-index: 1; | |
content: ""; | |
opacity: 0; | |
visibility: hidden; | |
background: url(../img/gradient.png) top left no-repeat; | |
background-size: cover; | |
} | |
} | |
&:hover, &:active { | |
.featured-image { | |
&:before { | |
opacity: 1; | |
visibility: visible; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment