I have two children in one parent element where first child is always visible but second one is visible on hover only. Since I have fit-content set for parent's width when I hover the parent elem expands. What I need is a smooth transition for this expansion. I do all this in React. Thanks
Check context please:
.parent{
display: flex;
justify-content: space-evenly;
background-color: #f31d84;
width: fit-content;
}
.icon{
margin: 5px;
}
.text{
display: none;
margin: 5px;
}
.parent:hover .text{
display: block;
}
<div>
<div class='parent'>
<div class='icon'>
icon
</div>
<div class='text'>
texttexttexttext
</div>
</div>
</div>