I'm trying to create a layout where the whole screen is used.
The header section should always be visible at the top. The footer section should always be visible at the bottom. The search section should appear just above the footer. The content section should take up the remainder of the space and show a right-hand scrollbar if the content overflows.
<div class="flex min-h-screen flex-col">
<div class="flex flex-grow flex-col bg-gray-100" id="inner">
<div class="border-spacing-1 border p-2 text-center">Header</div>
<div class="max-h-[calc(100vh-11rem)] flex-grow overflow-auto" id="content">
<div class="p-4 text-center">Item</div>
<div class="p-4 text-center">Item</div>
<div class="p-4 text-center">Item</div>
<div class="p-4 text-center">Item</div>
<div class="p-4 text-center">Item</div>
<div class="p-4 text-center">Item</div>
<div class="p-4 text-center">Item</div>
<div class="p-4 text-center">Item</div>
<div class="p-4 text-center">Item</div>
<div class="p-4 text-center">Item</div>
<div class="p-4 text-center">Item</div>
<div class="p-4 text-center">Item</div>
<div class="p-4 text-center">Item</div>
<div class="p-4 text-center">Item</div>
<div class="p-4 text-center">Item</div>
</div>
<div class="border-spacing-1 border p-2 text-center" id="search">Search Box</div>
</div>
<div class="mt-auto border-spacing-1 border p-2 text-center" id="footer">Footer</div>
</div>
This sort of works, but with a horrible hard-coded calculation for the content height. Is there a tailwind way of making the max-h of content always fit the available space?