CSS Grid Areas
After all these years of using CSS Grid and I still feel like I haven’t grokked everything that it’s capable of. Ahmad Shadeed’s latest interactive tutorial is a great reminder of that where he’s written about named grid areas and explains the following bit of CSS:
.layout {
grid-template-columns: [full-start] 1fr
[content-start] 2fr
[content-end] 1fr [full-end];
}
So what Ahmad has done here is defined and named specific areas of a grid and then he can use them elsewhere in his CSS like this:
.layout-item {
grid-column: content-start / content-end;
}
Smart stuff.