-
Notifications
You must be signed in to change notification settings - Fork 708
[css-sizing] Cyclical definition of min-content size #12081
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
That's no real definition. Some layouts have a real definition, e.g. https://drafts.csswg.org/css-grid/#intrinsic-sizes. Some layouts don't have a proper definition for intrinsic sizes, or don't have a proper spec at all.
This is obsolete terminology. The "preferred minimum width" is actually the min-content size, and the "preferred width" is the max-content size.
I'm not sure I understand what you want, maybe But this seems unrelated to the cyclic spec definitions. Better keep spec topics here, and leave questions about which code achieves what you want for stackoverflow. |
Okay, sounds good - the only reason I added it was sometimes posting requests for clarification without providing usage context gets push back from project owners.
So, in summary, it's not defined? In that case, stepping back, I would like to propose a method to set the preferred size for a block element without affecting the min-content size -- however, without a more complete spec for min-content size it's not clear if such a method already exists or not.
I'm not entirely sure how this computes - it indeed makes the min-size 2px, but the preferred size appears to also be 2px and not 300px. TBH I would have expected this to result in a value with a floor of 300px... Edit: Ah, is that related to cyclic percentage/ #10969 ? |
Not in general. For example, for block containers see #9120
Well, grid layout first determines track sizes using intrinsic contributions, so a percentage in |
Ah okay, x2. So that is cyclic percentage. Since you mentioned this isn't actually defined, then a definition is what I'm most interested in. I'll close this, 9120 seems like what I want. Thanks! |
Cross-link: https://stackoverflow.com/questions/79573662/how-is-css-min-content-actually-defined |
Here's the path of definitions:
I asked on SO but it was closed as "not suitable for this site", but this also seems like a spec issue so I thought I'd bring it up here.
I'd guess that at some point there's a definition for minimum size like "text plus text advance, borders, images, padding, margin", but I have this example:
where the inner div is still shown at 300px.
Specifically I was trying to find how to create a div with a 300px default/preferred size but a 2px (border) minimum.
Edit: I can work around this by using an extra grid element with minmax instead of using
width
on a block element directly:but I'd like to believe this shouldn't be necessary and it should be possible to set preferred width-only in a single element.
In both examples I have
width: min-content
on the parent to confirm the min-content size, however if that's removed it shows the more natural context, e.g. a window where if larger than 300px it shows at 300px, but if the window is shrunk it shrinks down to 2px.The text was updated successfully, but these errors were encountered: