-
Notifications
You must be signed in to change notification settings - Fork 708
[css-grid] How to distribute space using flex ratios when the sum is 0? #3694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
…item space to flexible tracks. #3694
OK, yeah, we definitely need to fix the divide-by-zero case. :) I agree with the behavior you describe, but, while I think your weighting algorithm is very clever in how it can handle the space distribution of both steps, it makes the section a bit harder to digest. So I'm keeping the current structure, but adjusting the step that assigns weights to match your suggestion. Agenda+ to request review. |
The CSS Working Group just discussed
The full IRC log of that discussion<dael> Topic: How to distribute space using flex ratios when the sum is 0?<dael> github: https://github.com//issues/3694 <dael> fantasai: This was we forgot to handle divide by 0 case when dividing. minimal fix to only do that if the sum is >0. If sum is 0 we distribute space equally <fantasai> https://github.com/w3c/csswg-drafts/commit/5a43ab7210d08c9a012a7697eb39a382f8133079 <dael> fantasai: dif^ <dael> fantasai: Refers to how we split up space for intrinsic track sizes. Have to distribute space even though it's flex 0. If there are flex ratios we can use we do. if they're all 0 we can't divide so we say do equally in that case <dael> astearns: Any comments? <dael> astearns: I don't see in diff anything about distributing equally <dael> fantasai: [reads] <dael> astearns: Alright so default case is in previous text? <dael> fantasai: Yes. <dael> astearns: Objections? <dael> RESOLVED: Accept change in https://github.com/w3c/csswg-drafts/commit/5a43ab7210d08c9a012a7697eb39a382f8133079 |
From https://drafts.csswg.org/css-grid/#algo-spanning-flex-items,
This "according to the ratios" seems slightly ambiguous to me.
What if the sum of ratios is 0? Then each track should get a 0/0 fraction of the distributed space, doesn't make sense. I guess in this case space is distributed equally, like for non-flexible tracks.
I think it would be more clear if the algorithm said:
This should be in the real algorithm, https://drafts.csswg.org/css-grid/#extra-space, not as some kind of vague amendment in https://drafts.csswg.org/css-grid/#algo-spanning-flex-items
Alternatively, not sure if something special should happen when the sum of weights is less than 1, akin to
The text was updated successfully, but these errors were encountered: