JSFiddle - React, Tailwind, and code Playground

by silentimp

HTML

<script src="http://yandex.st/modernizr/2.0.6/modernizr.min.js"></script>
<div class="mojo"></div>

CSS

.mojo{
width:50px;
height:50px;
 background-color:#f00;   
}

JavaScript

var style = document.documentElement.appendChild(document.createElement("style")),
index = Modernizr._prefixes.length,
rule = "";

while(index--){
    rule+="@"+Modernizr._prefixes[index]+"keyframes 'test'{ 0%{opacity:1;} 50%{opacity:0;} 100%{opacity:1;}} ";
}

style.sheet.insertRule(rule);
$(".mojo")[0].style[Modernizr.prefixed('animation')] = "'test' 2s ease-out both infinite";