1
Took a dev's advice on subgrid and it cleaned up my whole layout
Someone on a pull request told me to stop nesting grids and just use subgrid instead, and now my product cards actually line up without a million hacks. Has anyone else had a similar shift in how they handle uneven content blocks?
2 comments
Log in to join the discussion
Log In2 Comments
the_harper11d ago
DUDE yes. I had this exact same thing happen last month on a project and it was like a light switch flipped in my brain. I was nesting grids like crazy trying to get my blog cards to all be the same height with different amounts of text. Subgrid just made everything click into place without any of the weird margin or padding hacks I was doing before. It feels illegal that something that cleans up your code so much is actually the right way to do it.
6
schmidt.blake11d ago
Ha, "feels illegal" is the perfect way to put it. I spent a solid afternoon last week staring at my screen like a fool, finally accepting that my old hacky way was just never gonna cut it for equal-height cards. My code literally looked like spaghetti with all those custom padding calculations. Dropping in subgrid was honestly embarrassing because of how much simpler it made everything. I half expected someone to tap me on the shoulder and tell me I was cheating or something. Your mileage may vary but for me it was one of those rare wins where the simpler solution actually works better.
4