I have two divs stacked on top of each other. The top div contains an accordion menu, and is 300px tall when fully expanded. The CSS for the bottom div is:
height:calc(100vh - 300px)
This works great when the accordion in the top div is fully expanded - the bottom div fills up the rest of the vertical space of the viewport.
The problem occurs when the accordion in the top div gets collapsed. Now the top div is only 50px tall, but the CSS for the bottom div is still subtracting 300px from 100vh.
Is it possible to have the value being subtracted from 100vh be a variable instead of a fixed value? So instead of a hard coded pixel amount, it's subtracting whatever the height of the top div is.