Skip to content

Instantly share code, notes, and snippets.

@saucer-jp
Created June 15, 2012 06:52
Show Gist options
  • Save saucer-jp/2935080 to your computer and use it in GitHub Desktop.
Save saucer-jp/2935080 to your computer and use it in GitHub Desktop.
sass: mixin fadeIn
$prefix:'-moz-', '-webkit-', '-o-', '-ms-', '';
// ********************
// fadeIn
// ********************
@mixin keyframe-fadeIn {
0% { opacity:0; }
100% { opacity:1; }
}
@-moz-keyframes fadeIn {
@include keyframe-fadeIn;
}
@-webkit-keyframes fadeIn {
@include keyframe-fadeIn;
}
@-o-keyframes fadeIn {
@include keyframe-fadeIn;
}
@-ms-keyframes fadeIn {
@include keyframe-fadeIn;
}
@keyframes fadeIn {
@include keyframe-fadeIn;
}
@mixin fadeIn( $arg ) {
$keyframe-name:fadeIn;
$duration:$arg;
@each $p in $prefix {
#{$p}animation:$keyframe-name $duration;
}
}
// e.g. @include fadeIn( 2s );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment