JSFiddle - React, Tailwind, and code Playground
by Abdul Ahmad
HTML
<div class='text-box'>
<div class='box-shadow'></div>
<span class='text'>
stuff asdf a sdf as df asdf;jas ;lfdknas ;foargoan aosg paoshf aosdfhpaso fdnaspodf haposdghap sodgh paosdghp aoshdgp oashdgpa osdhg
</span>
</div>
CSS
.text-box {
position: relative;
width: 200px;
background-color: white;
padding: 10px;
font-family: arial;
font-size: 14px;
}
.text-box .box-shadow {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
box-shadow: 0 1px 3px 0px black;
opacity: 0.5;
}
.text-box .text {
display: block;
height: 30px;
padding: 0;
overflow: hidden;
transition: padding 0.15s ease;
}
.text-box:hover .text {
height: auto;
padding: 15px 0;
transition: padding 0.15s ease;
}