4 ms·
I’m in the same boat. ”Learnt CSS” in the late 90’s/early 00’s, and learnt it all over again in the 010’s. It’s true, CSS2 is all you need to build any layout.
by eurasiantiger 6y ago
I’m in the same boat. ”Learnt CSS” in the late 90’s/early 00’s, and learnt it all over again in the 010’s.
It’s true, CSS2 is all you need to build any layout. I actually prefer float grids over flexbox and CSS grid. Float grids are so simple to use in comparison, and all it requires is a list of breakpoints and two to three SCSS mixins, depending on how fancy you wanna get.
But no way I’d write it without modern tooling.
- sixQuarks 6y agoAre you sure you know flexbox and grid well? I don’t see how you could prefer floats.
- petepete 6y agoGrid and flex let you do in five lines what used to take fifty. I'd never go back.
- eurasiantiger 6y agoThank you for your quadratic-or-worse layout calculations. Then people wonder why the web eats their phone battery.
- wwweston 6y agoFloats have their place. The conceptual model is simpler for some simple cases, and you can build layouts that reflow over different viewport sizes without worrying about breakpoints. Once you need equal-height boxes in your layout, though, it's time to use something else.
- eurasiantiger 6y agoThey are faster to render especially when resizing the window, and they work in the exact same mental model of layout as everything else in CSS: the box grows to fit its content. Flexbox and grid do not subscribe to this: flexbox shrinks/grows its content to fit itself. Grid is a configurable beast, something in between, and also makes it possible for grid content (not the container) to define how it itself is laid out.