JSFiddle - React, Tailwind, and code Playground

by demee

HTML

<div id="el">Some text here</div>

CSS

div#el {
    border: 1px solid black;
    cursor: pointer;
    transition: background 1s, border-radius 1s;
    padding: 10px;
    transition: color 1s;
}

div#el:hover,
div#el.new:hover {
    background: grey;    
    transition: background 1s, color 0.5s;
}

div#el.new {
    color: red;
    transition: color 0.5s, background: 1s;
}

JavaScript

setInterval(function(){
    $('#el').toggleClass('new');
}, 500)