JSFiddle - React, Tailwind, and code Playground
by mukkaram waheed
HTML
<input type="checkbox" class="toggle" name="ao-toggle" />
<canvas id="myCanvas">
</canvas>
CSS
input.toggle{
width: 100%;
height: 100%;
position: absolute;
top: 0px;
left: 0px;
margin: 0;
padding: 0;
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
opacity: 0;
z-index: 100;
border: none;
cursor: pointer;
}
input.toggle:checked + #myCanvas{
border:1px solid #000000;
background-color:#000;
width:400px;
height:200px;
-webkit-transition:0.5s;
transition:0.5s;
}
#myCanvas{
border:1px solid #000000;
background-color:#ccc;
width:200px;
height:100px;
-webkit-transition:0.5s;
transition:0.5s;
}