A dev at a meetup in Austin said he deleted 60% of his CSS after switching to grid, and I can't stop thinking about it | CSS Battle Tactics - The Design Community Hub
A dev at a meetup in Austin said he deleted 60% of his CSS after switching to grid, and I can't stop thinking about it
Last Thursday I was at a small front end meetup in Austin and a guy demoed his dashboard rebuild. He said he ripped out around 60 percent of his stylesheet once he moved the card layout to CSS grid with named areas. I have been writing nested flexbox wrappers for so long that the thought of deleting that much markup never crossed my mind. So the next morning I took an old pricing page I built and swapped the three column row for a grid template with repeat and minmax, and the whole thing was about 8 lines instead of the pile of divs I had before. It mostly worked but my gutters are off on tablet sizes and I think my gap value is fighting with an old margin rule somewhere. It got me thinking about which layouts I keep rebuilding out of habit when grid or even subgrid does it in a couple lines. Curious what tricks you all reach for when you want a layout to collapse from desktop to mobile without a pile of media queries, because mine still look like a mess.