- From: Daniel Holbert via GitHub <sysbot+gh@w3.org>
- Date: Wed, 02 Feb 2022 00:58:33 +0000
- To: public-css-archive@w3.org
For completeness, I'll point out that browsers also agree that the div in the other example here (the row-oriented flex container that [@davidsgrogan asked about](https://github.com/w3c/csswg-drafts/issues/6794#issuecomment-1026190182) does indeed have a 100px min-content width which (as fantasai [noted](https://github.com/w3c/csswg-drafts/issues/6794#issuecomment-1026193341)) agrees with Firefox's behavior in that case. Here's [a simplified example with `width:min-content`](https://livedomviewer.com/?%3C!DOCTYPE%20html%3E%0A%3Cdiv%20style%3D%22aspect-ratio%3A%201%2F2%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20height%3A%20100px%3B%20width%3A%20min-content%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20background%3A%20blue%3B%20border%3A%205px%20solid%20orange%22%3E%0A%20%20%3Cdiv%20style%3D%22width%3A%20100px%3B%22%3E%3C%2Fdiv%3E%0A%3C%2Fdiv%3E) to demonstrate that the min-content width is indeed 100px there: ```html <div style="aspect-ratio: 1/2; height: 100px; width: min-content; background: blue; border: 5px solid orange"> <div style="width: 100px;"></div> </div> ``` In this^ case, the min-content width does actually come from its content, i.e. its 100px-wide child; but if you [edit the example to remove that child](https://livedomviewer.com/?%3C!DOCTYPE%20html%3E%0A%3Cdiv%20style%3D%22aspect-ratio%3A%201%2F2%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20height%3A%20100px%3B%20width%3A%20min-content%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20background%3A%20blue%3B%20border%3A%205px%20solid%20orange%22%3E%0A%3C%2Fdiv%3E), then browsers also agree that the div ends up being 50px wide there (from the aspect-ratio and cross-axis size). So, this seems to be further confirmation that the min-content size is indeed established by the aspect-ratio and the opposite-axis property (though it might be bigger the element contains content that is even larger). -- GitHub Notification of comment by dholbert Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6794#issuecomment-1027471017 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 2 February 2022 00:58:35 UTC