- From: Michiel Bijl <michiel@agosto.nl>
- Date: Fri, 10 Jul 2015 11:01:43 +0200
- To: Den <cyraid@gmail.com>
- Cc: www-style@w3.org
- Message-Id: <B44B07C9-BC90-4333-83D0-4A6BA240C454@agosto.nl>
Jonathan Kingston proposed something like this on Specifiction: http://discourse.specifiction.org/t/flex-suggestions/921/ <http://discourse.specifiction.org/t/flex-suggestions/921/>. He called it “collapse of outer margins”, setting `outer-item-margin: 0;` on the flex-container. Would it really be necessary to add two new properties for something that basically does the same as `margin`? —Michiel > On 05 Jul 2015, at 18:13, Den <cyraid@gmail.com> wrote: > > Hi there, > > There seems to be issues with creating a static spacing of children in the flex container. There are questions on the net already which ask this, and the only 'solution' would be to enforce a constant margin to all children, and a negative margin of the same value to negate. Let's say you want to create a layout of children all 4px spaced, you could accomplish this with margin, but you will have unnecessary spacing when there is no wrapping. > > Example: > > Let's say you have a 'row' layout of 4 same size boxes, and it covers about half of the screen and you are spacing them out with '4px' margin-right. Now let's say you resize the browser and it wraps, 2 are on the top, and 2 are on the bottom; now the 2 children that are wrapped are hugging the top row. You would say you could do 'margin-bottom' on the items, but then if they aren't wrapped, the content under it will have unwanted spacing. > > Proposal: > > Add a new property could be added called flex-spacing-x, and flex-spacing-y (using length as values obviously). These properties could share the same priority when calculating as 'margin'? Respecting min-width, etc. > > I'm currently facing this problem as we speak, and the only known work-around is the margin negation. > Any thoughts? > > - Dennis Fehr
Received on Friday, 10 July 2015 09:02:33 UTC