9 ms·
Out of curiosity, why doesn't the stack layout use flexbox? It seems like flexbox is the perfect fit for such a layout.
by vedantroy 7y ago
Out of curiosity, why doesn't the stack layout use flexbox? It seems like flexbox is the perfect fit for such a layout.
- chiefalchemist 7y agoBecause it's a just a simple stack. The intent is concistent margins between siblings within the wrapper. What came to mind were paragraphs. Or perhaps images. Or both?
- codedokode 7y agoDisplay: block fits better because it has been around for more than 15 years unlike flexbox. And flexbox has no advantages in this case.
- have_faith 7y agoMargins of flex child elements won't collapse automatically like regular elements. It can be solved but it would be unnecessarily complex for the simplicity of the layout.
- sureaboutthis 7y agoFlex is great for one directional layout within a box. It is not great for two dimensions which most layout is concerned with.
- nhooyr 7y agoThe stack is not two dimensional.
- sureaboutthis 7y agoHas nothing to do with what we're talking about.
- threehams 7y agoIf other browsers besides Firefox add support for the gap property, Flexbox will be perfect for this. The owl approach has some subtle issues, like not taking into account elements which show/hide based on breakpoint.
- btbuildem 7y agoPardon my naivete, but wouldn't stack be just a list of divs?