JSFiddle - React, Tailwind, and code Playground
HTML
<a href="#">Hej jeg har css hover effekt</a>
CSS
/*a {
-moz-transition: all 0.5s ease-in-out;
-webkit-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
-ms-transition: all 0.5s ease-in-out;
color:#f03;
background:#666;
padding:10px;
}
a:hover {
color:#f0c;
background:#222;
}*/
body{background:green;}
JavaScript
/*
* jQuery Color Animations
* Copyright 2007 John Resig
* Released under the MIT and GPL licenses.
*
* RGBA support by Mehdi Kabab <http://pioupioum.fr>
*/
(function(jQuery){
jQuery.extend(jQuery.support, {
"rgba": supportsRGBA()
});
// We override the animation for all of these color styles
jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){
jQuery.fx.step[attr] = function(fx){
var tuples = [];
if ( !fx.colorInit ) {
fx.start = getColor( fx.elem, attr );
fx.end = getRGB( fx.end );
fx.alphavalue = {
start: 4 === fx.start.length,
end: 4 === fx.end.length
};
if ( !fx.alphavalue.start ) {
fx.start.push( 1 );
}
if ( !fx.alphavalue.end ) {
fx.end.push( 1 );
}
if ( jQuery.support.rgba &&
(!fx.alphavalue.start && fx.alphavalue.end) || // RGB => RGBA
(fx.alphavalue.start && fx.alphavalue.end) || // RGBA => RGBA
(fx.alphavalue.start && !fx.alphavalue.end) // RGBA => RGB
) {
fx.colorModel = 'rgba';
} else {
fx.colorModel = 'rgb';
}
fx.colorInit = true;
}
tuples.push( Math.max(Math.min( parseInt( (fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0) ); // R
tuples.push( Math.max(Math.min( parseInt( (fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0) ); // G
tuples.push( Math.max(Math.min( parseInt( (fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0) ); // B
if ( fx.colorModel == 'rgba' ) {
// Alpha
...