JSFiddle - React, Tailwind, and code Playground
HTML
<div class="container">
<span class="child1">Fixed</span>
<span class="child2">Dynamic Width</span>
</div>
<div class="container">
<span class="child1">Fixed</span>
<span class="child2">Here is a Dynamic Width box</span>
</div>
CSS
.container {
width: 200px;
height: 50px;
border: 1px solid green;
overflow: hidden;
white-space: nowrap;
text-align: left;
direction: rtl;
}
span {
height: 50px;
display: inline-block;
}
.child1 {
background: aqua;
width: 50px;
margin-right: -50px;
float: right;
transition: margin-right .2s;
}
.child2 {
background: tomato;
}
.container:hover .child1 {
margin-right: 0;
}