JSFiddle - React, Tailwind, and code Playground

by jakelauer

HTML

<div></div>

CSS

div
{
    width: 50px;
    height: 50px;
    background: red;
    opacity: 1;
    
    transition: 0.5s;
    -webkit-transition: 0.5s;
    /*    IDEAL TRANSITION
       
    transition: 0.5s opacity 0s;
    -webkit-traisition: 0.5s opacity 0;
    
    */
}

div.on
{
    width: 100px;
    height: 100px;
    background: green;
    opacity: 0.5;
}

JavaScript

$('div').click(function(){
    $(this).toggleClass('on')
})