A Pen by Captain Anonymous on CodePen.
Created
February 2, 2017 21:44
-
-
Save anonymous/3bcf3eb696e146d4f9f65c7b0a4dbf19 to your computer and use it in GitHub Desktop.
tngHy
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
<div class="my-container"> | |
<div class="my-element"></div> | |
<div class="my-element"></div> | |
<div class="my-element"></div> | |
</div> |
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
@import "compass/css3"; | |
.my-element { | |
@include transition(opacity 0.3s); | |
@include opacity(0); | |
@include inline-block; | |
margin: 5px; | |
width: 100px; | |
height: 100px; | |
background: tomato; | |
// Loop through the items and add some delay. | |
@for $i from 1 through 3 { | |
&:nth-child(#{$i}) { | |
@include transition-delay(0.1s * $i); | |
} | |
} | |
.my-container:hover & { | |
@include opacity(1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment