3 ms·
Well, flexbox was much simpler and easier to standardize on and implement sooner. It has been available in all major browsers since 2015. Grid is great, and no
by lambda 8y ago
Well, flexbox was much simpler and easier to standardize on and implement sooner. It has been available in all major browsers since 2015.
Grid is great, and now works in most places, but it was good to have flexbox while grid was still in process; it only became available in Edge, in the final form, late last year, making it now available on all major browsers.
You're always going to have cases like this; where there's something that's simple that works now, and something better that comes later. If you always wait for the better one, it will take forever for things to get done. Not to mention that flexbox is probably simpler and easier to understand and use for some of the simple use cases, so people will still probably continue to use it despite the fact that grid is available.
- c-smile 8y agoProblem is that flexbox is a subset of grid. Or to be precise: flexbox and grid are just two forms in a set of layout methods that we already have and will have in future. In normal architectural process we would establish first common infrastructure for all layout methods. I've proposed something like that 9 years ago: https://www.terrainformatica.com/w3/flex-layout/flex-layout.htm https://www.terrainformatica.com/w3/flex-layout/flex-layout.... but it didn't go through (Who am I and who are browser vendors?) So we would have single property that defines layout methods: display:block; flow: horizontal; // flexbox now flow: vertical; // ditto flow: grid( rows: ..., columns: ... ); // grid flow: multi-column( columns: ... ); // current multi-col flow: stack; flow: row(label,input); // variant of grid So flexbox and grid are just parts of larger entity - set of current and future layout methods. Yet flexes has to be units as they a) were from the very beginning ( see "proportional" units here: http://www.w3.org/TR/html401/struct/tables.html#h-11.2.4.4 http://www.w3.org/TR/html401/struct/tables.html#h-11.2.4.4 ) and b) can be used in other layouts and properties (why not margin-left:1fr ?) Note that each layout method has its own parameters in their own namespaces. Currently set of CSS properties is about 400 in one flat namespace. Any junior architect will tell you that this is close to unmanageable state. But we still pushing new stuff on that x'mas tree. It will fall down by its own weight as some moment, but who cares ...