I'm trying to make a responsive layout footer for a google map. Because i have both a footer and a sidebar i'm trying to use grid to accomplish this. I have it nearly working except that the row refuses to collapse all the way because the google map doesn't actually take up any real space.
There are several partial solutions out there but they all fall flat attempting to do one thing or another. This solution gets close but setting an upper limit does not work. How do you collapse unused row in a CSS grid?
.grid {
width: 500px;
height: 500px;
display: grid;
grid-template-columns: [center]100fr [sidebar]auto;
grid-template-rows: [center]100fr [footer]minmax(auto, 30%);
}
.center {
background-color: blue;
grid-column: center;
grid-row: center;
}
.sidebar {
background-color: red;
grid-column: sidebar;
grid-row: center / span 2;
}
.footer {
background-color: orange;
grid-column: center;
grid-row: footer;
overflow: auto;
}
<div class="grid">
<div class="center">
CENTER CONTENT
</div>
<div class="sidebar">
SIDEBAR
</div>
<div class="footer">
APPLES APPLES APPLES APPLES APPLES APPLES APPLES APPLES APPLES
APPLES APPLES APPLES APPLES APPLES APPLES APPLES APPLES APPLES
APPLES APPLES APPLES APPLES APPLES APPLES APPLES APPLES APPLES
</div>
</div>
How can i set an upper limit for an item and also allow it to collapse when empty (or smaller than max size).