Skip to content

Instantly share code, notes, and snippets.

@telekid
Last active September 27, 2015 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save telekid/fcf8c153fbb61a658a4e to your computer and use it in GitHub Desktop.
Save telekid/fcf8c153fbb61a658a4e to your computer and use it in GitHub Desktop.
RWojKV
/************************************************/
/* Author: Jake Zerrer */
/* */
/* Simple Mixin for creating a single instance */
/* of a css keyframe animation. The animation */
/* name is made unique to prevent namespace */
/* collisions. */
/* */
/* License: MIT */
/************************************************/
@mixin uniqueAnimation ($name: null, $duration: null, $timing-function: null,
$delay: null, $iteration-count: null, $direction: null,
$fill-mode: null, $play-state: null) {
$full-name: $name + "-" + unique-id() ;
@keyframes #{$full-name} {
@content;
}
animation: $full-name $duration $timing-function $delay $iteration-count
$direction $fill-mode $play-state;
}
/* Example of use: */
p {
@include uniqueAnimation(jake, 3s, ease-in, 1s, infinite) {
from {
color: blue;
}
to {
color: red;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment