JSFiddle - React, Tailwind, and code Playground
by vals
HTML
<div class="container">
<div class="test">TEST
</div>
</div>
CSS
.test {
width: 100px;
height: 100px;
position: relative;
left: 30px;
top: 30px;
background-color: lightgreen;
transition: all 2s linear;
-webkit-transform-style: preserve-3d;
}
.test:after {
content: '';
right: 0px;
bottom: 0px;
position: absolute;
top: 0px;
left: 0px;
background: linear-gradient(to right, black, transparent);
-webkit-transform: rotateY( 180deg );
-webkit-transform-style: preserve-3d;
-webkit-backface-visibility: hidden;
}
.container:hover .test {
-webkit-transform: rotateY( 180deg );
}