A Pen by Jake Zerrer on CodePen.
Last active
September 27, 2015 20:13
-
-
Save telekid/fcf8c153fbb61a658a4e to your computer and use it in GitHub Desktop.
RWojKV
This file contains 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
p hi there! |
This file contains 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
/************************************************/ | |
/* 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