I'm having a really hard time creating the following layout using the CSS grid feature, and I'm not sure if it's even possible:
I could potentially put the top and right bars outside the grid in a table, but since the columns in the repeating part of the grid are a fixed width, I haven't found a way not to leave a space between them and the sidebar without letting them stretch.
I tried a lot of different things and none of them worked. I would think a solution would look something like that:
.my_grid {
display: grid;
justify-content: center;
grid-template-columns: repeat(auto-fit, 300px);
}
.grid_top_bar {
grid-row-start: 1;
grid-row-end: 1;
grid-column-start: 1;
grid-column-end: -1;
}
.grid_right_side_bar {
grid-row-start: 2;
grid-row-end: -1;
grid-column-start: -1;
grid-column-end: -1;
}
.grid_item {
}
<div class="my_grid">
<div class="grid_top_bar">...</div>
<div class="grid_right_side_bar">...</div>
<!-- repeating items -->
<div class="grid_item">...</div>
<div class="grid_item">...</div>
<div class="grid_item">...</div>
...
</div>
... but of course that doesn't work. Any idea if/how this can be done?