JSFiddle - React, Tailwind, and code Playground
HTML
<div class="parent">
<div class="child">
regular child
</div>
<div class="child">
<div class="sub-parent">
<div class="sub-child">
this one has a dynamic height
</div>
<div class="sub-child">
this one should fill the remaining height and be scrollable
</div>
</div>
</div>
</div>
CSS
.parent {
display: table;
height: calc(100vh - 200px);
background-color: white;
border: 1px solid #eee;
}
.child {
display: table-cell;
height: 100%;
}
.child:nth-child(1) {
background-color: blue;
color: #fff;
}
.child:nth-child(2) {
background-color: yellow;
}
.sub-parent {
display: block;
background-color: pink;
height: 100%;
}
.sub-child {
width: 100%;
float: left
}
.sub-child:nth-child(1) {
background-color: red;
color: #fff;
}
.sub-child:nth-child(2) {
background-color: orange;
overflow-y: scroll;
}