Skip to content

Instantly share code, notes, and snippets.

Created February 2, 2017 21:44
Show Gist options
  • Save anonymous/3bcf3eb696e146d4f9f65c7b0a4dbf19 to your computer and use it in GitHub Desktop.
Save anonymous/3bcf3eb696e146d4f9f65c7b0a4dbf19 to your computer and use it in GitHub Desktop.
tngHy
<div class="my-container">
<div class="my-element"></div>
<div class="my-element"></div>
<div class="my-element"></div>
</div>
@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