I'm creating a sidebar which contains a searchfield and 3 lists of items.
- The first list should take 50% height if needed
- The second and third list should split the height to 25% / 25%, but when the second or third list is empty, the other one should take as much space as available (so max is 50% - headline of the empty list)
- if a list is bigger then the available height, it should add a scrollbar.
Over the three lists is a small searchfield which size is 7vh.
right now im trying it in the following way:
<div style="height: 100vh">
<input (...) style="height: 7vh" />
<div style="height: 93vh">
<div class="list_1_container" style="max-height: 46.5vh">
<LIST />
</div>
<div class="list_2_container" style="max-height: 46.5vh">
<LIST />
<LIST />
</div>
</div>
</div>
This doesn't work so far. And I think using magic numbers (100vh, 7vh...) is bad for responsibility.
Does anyone know a good solution for this?