-
Notifications
You must be signed in to change notification settings - Fork 707
[css-grid] Automatic minimum size clamping by grid area should transfer through aspect ratio #767
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
Yes, I think this is a good idea for "transferred size". Firefox currently doesn't do this -- we only clamp the intrinsic size, but that can lead to non-intuitive results since it may overflow the clamped axis when stretching an image with preserved ratio. I don't think clamping should shrink an item below its specified I wonder if it would be better to define the grid area clamping in terms of |
Actually, I was mostly thinking about a transferred size that comes from stretching an item with a preserved ratio when I wrote the above. I'm less sure it's a good idea when the transferred size comes from an actual specified size in the other axis. We might want to treat those differently... |
Keep in mind that we're clamping a minimum size! Not the actual size. :) Defining it in terms of The specified size is a maximum on that minimum -- it's there so that if the specified size is less than the intrinsic size, then we use the specified size as the minimum instead. A specified size doesn't increase the automatic minimum: we take the most conservative minimum as the automatic minimum, so it's min(specified size, content size) if there's a specified size and min(transferred size, content size) if there isn't but there's an aspect ratio, and simply content size if neither specified size nor transferred size exist. |
All right, fix checked in However, if the <a>grid item</a> spans only <a>grid tracks</a>
that have a <a lt="fixed sizing function">fixed</a> <a>max track sizing function</a>,
- its <a>automatic minimum size</a> in that dimension
- is further clamped to less than or equal to the size necessary
+ the “specified size” and “content size” in that dimension
+ (and the input to the "transferred size" in the other dimension)
+ are further clamped to less than or equal to the size necessary
to fit its margin box within the resulting <a>grid area</a> (flooring at zero)
+ so as to prevent the automatic minimum from forcing overflow of its fixed-size grid area |
Agenda+ to get wg resolution |
WG resolved to take this edit. |
I think this is an error in the clamping rule... The spec says in https://drafts.csswg.org/css-grid/#min-size-auto
I think that if the transferred size (this dimension's size transferred through the aspect ratio to the other dimension) is controlling the size in the other dimension, then that transferred size should also get clamped accordingly.
Possible edits for this would be
Let me know what you think.
The text was updated successfully, but these errors were encountered: