H
10

Just realized I was overthinking CSS after a coworker showed me his approach

I was stuck on a layout issue for like 3 hours, trying to use flexbox with all kinds of weird hacks. Then my coworker Dave walked over, looked at my screen for maybe 30 seconds, and said "dude, just use grid with one line." He literally typed out "display: grid; grid-template-columns: repeat(3, 1fr);" and it worked perfectly. Hit different because I've been avoiding grid thinking it was too complicated. Has anyone else had a moment where you realized you were making coding way harder than it needed to be?
2 comments

Log in to join the discussion

Log In
2 Comments
coleman.jade
I mean it's not quite "one line" if you also need to set up the grid container first.
2
joelsanchez
So what counts as setup in your book? Is defining a parent container as grid really that different from setting display: flex to make flexbox work?
5