-
Notifications
You must be signed in to change notification settings - Fork 707
[css-grid] making percentage grid-gaps zero for the purpose of intrinsic sizing doesn't make sense #472
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
I think you're confused. Percentage gaps are defined to be sized exactly the same as an empty percentage-sized track. Is that not what you want? |
BTW, I've explained how I understand the percentage gaps in: #345 (comment) For widths I believe for track sizing we're already doing the same than in your example. In your case the 10% gap is 20px. For heights it's different, I don't see why you're resolving the 10% as 10px. grid: auto 10% auto / 100px 10% 100px; In that case the 10% column is resolved as 200px (against the intrinsic size). It strikes me as odd that for a row gap the 10% would be resolved different than a 10% track. |
Reply to @fantasai: When calculating intrinsic sizes (after track sizing), I want to
This is a very simple calculation, and doesn't involve any When calculating the number of repeat(auto-fill/fit) tracks (for That's it. No other changes are necessary. (In particular: I'm happy to help you with the spec text for this if you want. |
Reply to @mrego:
then the intrinsic size is ~444.44px. (i.e. 400 / (1.0 - 0.1) for the example above) |
FYI, the "size = sum_of_coords / (1.0 - sum_of_percentages)" I agree it might be too complicated for percentages in track sizes |
Okay, hang on a minute. So you're saying you want to back-compute percentages for grid-gap, but not for track sizes? In both
axes or just one?
I am somewhat interested in having grid-gaps work identically to similarly-sized empty tracks, for simplicity.
I'm also open to other ideas. However, I am still confused about what we're doing wrt percentage sizing, in general, per #347,
and maybe we should all have a talk about that first. Can you post some kind of position statement from your/Mozilla's
perspective into #347 and we can go from there? (Fwiw, TPAC is next week, so it's a good chance to sort this out.)
|
Yes.
Both.
Sure, I can understand that, but what I suggest is a small amendment Note that I'm not suggesting making any changes to the track sizing
It might be possible to improve percentage min track sizing too.
I'll discuss this with @dbaron et al. |
So the CSSWG discussed this, and concluded that percentage gaps should be treated identically to empty percentage tracks. However, we're leaving open the issue of how percentage tracks are resolved against an intrinsic parent: they can either be treated as auto (like percentage heights in an auto-height container) or be back-computed (as in table cells) but not the mix of both that causes overflow. Further discussion of percentage sizing against intrinsic containers will be ongoing; it affects shrinkwrapped blocks (like floats) as well, so is a broader topic. We're hoping to resolve that in Seattle if not sooner. |
@MatsPalmgren it would be nice if you can share your thoughts on issue #509 too. Thanks! |
It was resolved in issue 345 that percentage grid-gaps are zero
for the purpose of intrinsic sizing:
#345
I think this needs to be revisited. It's counterintuitive that
percentage grid-gaps are zero while percentages in other properties
actually influence the intrinsic sizing. Making them zero doesn't
respect the author's intent.
It also contradicts how intrinsic sizing works in general:
#347
I think instead we should take either of these alternative options:
A. specify percentage grid-gap in some reasonable way for
the purpose of intrinsic sizing that harmonize with how
we want intrinsic sizing to work in general (issue 347)
B. move percentage grid-gaps to the next level of the CSS Grid spec
To help make a decision on this I have prototyped A in Gecko and
from what I can tell, it seems fairly easy to implement and spec
something that would work well. Here's an example:
https://people.mozilla.org/~mpalmgren/tests/grid/percent-intrinsic-sizing.html
(last two boxes are grids) and here's how it renders:
https://people.mozilla.org/~mpalmgren/tests/grid/percent-intrinsic-sizing.png
Thanks,
Mats
The text was updated successfully, but these errors were encountered: