W3C home > Mailing lists > Public > public-css-archive@w3.org > February 2019

Re: [csswg-drafts] [css-grid] minmax(auto, min-content) under a max-content constraint (#3565)

From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
Date: Wed, 20 Feb 2019 12:50:35 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-465560900-1550667033-sysbot+gh@w3.org>
Some of my points from #2303:

 - The limited min-/max-content contribution should be fully defined in its own subsection (together with the minimum contribution, I guess). Providing a simpler definition in the place where it's defined, and then adding amendments in references to it is less clear. Because not all references will be next to the amendments, and following the link won't provide the full definition.

 - The limited min-/max-content contribution should take `fit-content()` into consideration in the spanning case.

 - Clamping by the min-content contribution may not ensure that spanning items won't contribute more space than what they will end up using.

    Imagine you have a single grid item with a minimum contribution of 20px, a min-content contribution of 25px, and a max-content contribution of 100px. It spans two columns sized with `minmax(auto,min-content) minmax(auto,50px)`.

    When sizing the container under a max-content constraint, the limited max-content contribution will be 50px (100px clamped between 20px and 50px). This will be distributed equally, so both columns will end up with a base size of 25px. Then the minimum contribution, 20px, is distributed for growth limits. The 2nd column already has a growth limit of 50px, so it will remain that way, but the first column will change its growth limit from infinity to the base size, 25px. Then the 2nd column will be maximized and the grid container will be 75px wide.

    The you do layout for real. This time the `auto` minimums only distribute the minimum contribution, 20px. So the base size of each column becomes 10px. 20px are distributed again for the growth limits, the first one becomes 10px and the 2nd one remains 50px. So this time the columns will sum 60px. This is smaller than the grid container.

    IMO the sizing algorithm seems too aggressive reducing the growth limit when it was infinity and becomes finite. If there is free space, the 1st column should probably be allowed to grow until it reaches 25px (the min-content contribution, as dictated by the max track sizing function). This can be an unrelated issue, though.

-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3565#issuecomment-465560900 using your GitHub account
Received on Wednesday, 20 February 2019 12:50:37 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:44 UTC