Re:Relearn CSS layout
by vedantroy on Sunday June 16, 2019 @12:43PM
(#20196408)
Out of curiosity, why doesn't the stack layout use flexbox? It seems like flexbox is the perfect fit for such a layout.
[ Parent
| on HN ]
Re:Relearn CSS layout
by have_faith on Sunday June 16, 2019 @02:20PM
(#20197028)
Margins 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.
Re:Relearn CSS layout
by chiefalchemist on Sunday June 16, 2019 @01:04PM
(#20196524)
Because 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?
If 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.
Pardon my naivete, but wouldn't stack be just a list of divs?
Re:Relearn CSS layout
by codedokode on Sunday June 16, 2019 @01:32PM
(#20196741)
Display: block fits better because it has been around for more than 15 years unlike flexbox. And flexbox has no advantages in this case.
Re:Relearn CSS layout
by sureaboutthis on Sunday June 16, 2019 @08:17PM
(#20198788)
Flex is great for one directional layout within a box. It is not great for two dimensions which most layout is concerned with.
The stack is not two dimensional.
Re:Relearn CSS layout
by sureaboutthis on Monday June 17, 2019 @06:55AM
(#20201662)
Has nothing to do with what we're talking about.