DEV Community

Discussion on: When to use Flexbox and when to use CSS grid

Collapse
 
joelbonetr profile image
JoelBonetR 🥇

Nice article but incorrect in some ways.
Flex is one-dimension ok, that's true, but you can blend and nest it wherever is necessary, giving you a layout much more powerful than grid.

Let's set an example:
.flexrow { display:flex; flex-flow: row wrap;
.row-2-el {
.element {
flex: 0 1 50%;
max-width: 50%;
}
}
}

Now you can set a div class="flexrow row-2-el" with tones of div class="element" inside and it will be all a 2 per row layout. Imagine nesting it as needed and adding more layout options with flex, without needing to set the size of each column as you need on grid layout template. Simpler, clever, powerful.

Collapse
 
devbyrayray profile image
Dev By RayRay

I agree, some points are off.

But I think this sentence is incorrect:

Now, we don’t depend on those properties anymore to create our web pages

In some cases you still need position or floats. But yes they are not the only choices we have 😉

Collapse
 
joelbonetr profile image
JoelBonetR 🥇

of course, it's all about design and functional requirements after all, all properties and methodologies have a reason for existing (and coexisting) and a target project where to being applied on.

All front-end stuff is bigger every day and in some ways you need more aknowledgement than doing back end those days; I mean, you can do CRUD APIs applying standard security and good logic but on front you'll need logic too as well as many technologies and frameworks (react, angular, scss, html, node and so), how the turntables haha

Thread Thread
 
devbyrayray profile image
Dev By RayRay

Ohw absolutly! Totally agree.

Back in the days frontend was "just" HTML, CSS and a bit of jQuery. Now we moved a lot of those backend logic from the early days to JavaScript. Now frontend developers need more programming skills.

If you say in the current time, I'm a frontend developer you can mean a lot of things. Are you on the "front side" of the frontend (doing HTML, CSS, accesibility etc) or are you on the "back side" of the frontend (doing HTML,CSS, JavaScript, Routing etc).

A great read about that is "The Great Divide"

Thread Thread
 
joelbonetr profile image
JoelBonetR 🥇

I'll take a look for sure, tanks! :)