Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
[css-grid] Do all percentages behave as auto when computing minimum contribution? #3612
Percentages in preferred size are resolved with respect of the grid area. The grid area is being calculated, so I guess all percentages should be considered to behave as auto?
The change was done in #2367 as an Obvious Bugfix. Well, it doesn't seem that obvious to me, because the change was against the behavior of all Blink, Firefox and Edge at that time (Firefox later adapted to the spec in https://bugzil.la/1462854). In this example, there is no longer a green background in Firefox, but there is in Blink and Edge:
<div style="width: 0px"> <div style="display: grid; float: left; background: lime"> <div style="min-width: 0px; width: 100%">content</div> </div> </div>
I just want to confirm whether my understanding of the spec is correct and whether this implication was intentional. In #2367 @MatsPalmgren said "percentages should behave as auto when the percentage basis is indefinite" like implying only some percentages were affected, but it seems to me that all of them are affected.
OK, clarified the spec by saying "behaves as auto or depends on the size of its containing block in the relevant axis". (Also did some editorial restructuring to make it easier to read.) See https://drafts.csswg.org/css-grid-1/#min-size-contribution
@MatsPalmgren I'd appreciate your review!