-
Notifications
You must be signed in to change notification settings - Fork 496
Heights for flexbox children intrinsically-sized with CSS are not computed properly in Firefox #87
Comments
I think there is still some dispute about the correct behavior here. As it stands now, percentage-based top/bottom paddings resolve against Also, according to this thread, percentages that are based on the height of an element that is itself based on its content always resolve to As a simple workaround, you can always just put a block element inside the flex item to avoid this issue altogether. |
Late 2015 the spec got updated, now allowing both:
So it's not really a "flexbug", although it can leave one (including me) confused at first. It is acknowledged in the spec itself that the “wiggle room” created by this change is not ideal:
Above that it's also not advised to use the CSS intrinsic-sizing method method until this is resolved:
Related browser bugs:
As recommended above it's easy to bypass this issue by nesting an extra element inside your flex item. Here's a simple demo: https://codepen.io/bramus/pen/wqKbWq |
As per w3c/csswg-drafts#2085 (comment) and w3c/csswg-drafts#2085 (comment): both Edge and Firefox have expressed their intent to implement the Blink/Webkit behavior. Quoting @atanassov (Edge):
Quoting @dholbert (Firefox):
There's a lot of activity going on on the Firefox-related bug so I guess there's a chance we might see this change land rather soon. |
The relating Firefox bug just got closed and marked as resolved. The changes are planned to ship with the release of Firefox 60. |
When using the CSS intrinsic-sizing method to force an element to maintain an exact aspect ratio, Firefox computes the height as
0px
(tested Firefox 41.0.2 and Firefox Nightly).This might be related to Flexbug 5, I am not sure. The height for these intrinsically-sized flex children appear to be properly computed in IE11, Chrome 45.0.2454.101 (64-bit), and Safari 9.0.
The text was updated successfully, but these errors were encountered: