loading...

Discussion on: Do you use a CSS framework based on CSS Grid?

Collapse
flrnd profile image
Florian Rand

I'm not css expert, but as far as I know, css grid was designed as a layout system. There's a pretty good article in css tricks about css grid worth reading (Second time I link a css-tricks guide hurra for those guys!). A framework usually take care for a lot more things than css layout, like styling, theming, and a big etc. The main difference between flex and grid, is that grid was designed with a larger scale layout in mind, while flex box it's more about the components of an app (for a simple explanation).

That's why I think there's no css grid framework to the date, because you can use both. Layouts with grid are pretty simple, and you can use a framework like bulma, bootstrap or whatever you like the most on top of it.

Dan Also was spot on with older browsers support. I'm sure we will see something in the future but at this moment, nothing stops you to use your favourite framework on top of a grid layout.

Collapse
kenbellows profile image
Ken Bellows Author

Yes, it's true that a full CSS framework typically has utility classes for colors and components and such. In this case though, I was specifically talking about a framework that provides CSS Grid encapsulation, something that allows adding CSS classes to your HTML elements to handle defining and adding items to a grid rather than doing it in CSS yourself.

And yeah, I agree that Grid makes layout pretty easy out of the box, and I myself am not interested in using a framework. But I've heard more than a few people express frustration with the new syntax and the stack of new properties that need to be learned for Grid, and I've heard rumors that some exist. But I have yet to encounter any 🤔

Thread Thread
cookrdan profile image
Thread Thread
kenbellows profile image
Ken Bellows Author

Man, those three looked promising, but it turns out none of them are actually using display: grid ☹ All are using interesting combos of display: block, display: inline-block, display: table, and various float hacks to set up their grids

Thread Thread
kenbellows profile image
Ken Bellows Author

I did a little more digging on Github, and I found a few people experimenting with it and doing some interesting stuff, but nothing really public-beta-ready:

Nothing super robust, but some interesting experiments happening.

As I read through these though, all of them seem to be kind of superfluous, and as I read the code I keep thinking that I would just prefer to write the CSS directly, and specifying my grid with class names on my HTML tags just doesn't add that much value. Idk, it will be interesting to see what emerges in the next couple years.

Thread Thread
cookrdan profile image
Dan

I was fooled!! Didn’t have time to check before sleep—sorry!

Thread Thread
mindplay profile image
Rasmus Schultz

@kenbellows it seems like all three of these are using essentially the same class structure as most float-based grids - what's the point?

I mean, how something is implemented isn't all that interesting - not when it requires the same amount of CSS overall, but just has worse cross-browser support. 🤷‍♂️