- From: Andrew Baxter via GitHub <sysbot+gh@w3.org>
- Date: Tue, 15 Apr 2025 03:47:47 +0000
- To: public-css-archive@w3.org
andrewbaxter has just created a new issue for https://github.com/w3c/csswg-drafts: == [css-sizing] Cyclical definition of min-content size == Here's the path of definitions: * https://drafts.csswg.org/css-sizing-3/ 5.1 says "The min-content size of a box in each axis is the size it would have if it was a float given an auto preferred size in that axis (and no minimum or maximum size in that axis) and if its containing block was zero-sized in that axis. (In other words, the minimum size it has when sized as “shrink-to-fit”.)" There's a note about this not being specifically defined, but it's not clear if that means _within_ css3 (but it is defined in css2), if that's limited to replaced elements (given the position in the text), or if it refers to the entire min-content sizing. * https://drafts.csswg.org/css2/ 10.3.5 says "min(max(preferred minimum width, available width), preferred width)." There's a note about this not being specifically defined, but it's unclear if that refers to the entire algorithm or just "preferred width" or "preferred minimum width" which are indeed not defined in css 2 (but do appear to have definitions in css 3). * preferred width isn't defined in css2 * https://www.w3.org/TR/css-sizing-3/ 3.1.1 defines preferred width as "The width and height (physical) properties specify the preferred width and height of the box, respectively." * preferred minimum width is defined in css 2 as "calculate the preferred minimum width, e.g., by trying all possible line breaks. CSS 2 does not define the exact algorithm" i.e. it isn't defined * https://www.w3.org/TR/css-sizing-3/#min-content defines "preferred minimum width" via the "min-content inline size": "This is called the “preferred minimum width”" * In the same section, the "min-content inline size" is "The min-content size in the inline axis" * In the same section, the min-content size is "Formally, the size of the box when sized under a min-content constraint, see § 5 Intrinsic Size Determination. " * Which takes us back to the start 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: ``` <div style="width: min-content"> <div style=" border: 1px solid red; width: 300px; height: 0.5cm; max-width: 100%; "></div> </div> ``` 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. Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12081 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 15 April 2025 03:47:48 UTC