I have the following HTML and CSS:
.grid {
display: grid;
grid-template-areas:
'. b b b b b b . p p p .'
'. b b b b b b . s s s .';
&__item {
align-self: start;
background-color: #999;
&--body {
grid-area: b;
height: 20rem;
}
&--primarySidebar {
grid-area: p;
}
&--secondarySidebar {
grid-area: s;
}
}
}
<div class="grid">
<div class="grid__item grid__item--body">
Body
</div>
<div class="grid__item grid__item--primarySidebar">
Primary sidebar
</div>
<div class="grid__item grid__item--secondarySidebar">
Secondary sidebar
</div>
</div>
The output looks like this:
Codepen here: https://codepen.io/CaribouCode/pen/RwgRPvb
It looks like primarySidebar has stretched to fill 50% of the overall height. How do I prevent it doing that, and therefore remove the space between primarySidebar and secondarySidebar?
Note: It's essential I use grid and this DOM structure for other reasons, so what I'm looking for here is some CSS properties I can add to avoid the unwanted vertical space.
