The flexbox specification was updated making the default minimum size of flex items equal to the size of the content: min-width: auto
/ min-height: auto
.
You can override this setting with min-width: 0
/ min-height: 0
:
.content {
background: yellow;
flex: 1;
display: flex;
flex-direction: column;
min-height: 0; /* NEW */
min-width: 0; /* NEW */
}
http://jsfiddle.net/d4nkevee/1/
Bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1043520
Here are some details from the spec:
4.5. Implied Minimum Size of Flex
Items
To provide a more reasonable default minimum size for flex items, this
specification introduces a new auto
value as the initial value of
the min-width
and min-height
properties defined in CSS 2.1. (read more)
UPDATE
It appears that Chrome has updated their rendering behavior. Chrome 48 now emulates Firefox in terms of minimum flex sizing.
Based on reports in the following links, the solution above should work in Chrome 48, as well.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…