21
Just learned that grid-template-areas can be named with a single dot for empty cells
I was reading the MDN docs for a client project in Chicago and saw you can use a period instead of repeating the area name for empty grid cells. This cleaned up my code for a complex dashboard layout by about 15 lines. Has anyone else found a small syntax trick that made a layout much simpler to read?
3 comments
Log in to join the discussion
Log In3 Comments
king.dakota1mo ago
Those little syntax shortcuts are everywhere once you start looking. It's like finding a better way to fold a map or organize a toolbox. The clean-up isn't just about fewer lines, it makes the whole structure in your head clearer. I had a similar moment with logical properties in CSS for spacing.
7
blair_fox71mo ago
Exactly. It clicks and then you see the pattern everywhere. Had that happen with array methods in JavaScript. Chaining map and filter instead of writing huge loops. Code gets shorter but way more readable too. You stop fighting the language and start working with it. Makes everything feel less clunky.
8
danieljenkins25d agoTop Commenter
But sometimes that clarity is just an illusion.
5