I've found multiple stack overflow solutions that suggest to use align stretch in order to make one child occupy the rest of the available container height, but can't make it work for now.
P.S: I would like to keep the position absolution on the parent container.
.parent {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
align-items: stretch;
justify-content: stretch;
background-color: lightgrey;
}
.child-1 {
background-color: green;
width: 100%;
}
.child-2 {
background-color: yellow;
width: 100%;
align-self: stretch;
}
<div class='parent'>
<div class='child-1'>no need to stretch</div>
<div class='child-2'>would be nice to stretch to rest of available height</div>
</div>