W3C home > Mailing lists > Public > public-css-archive@w3.org > March 2017

[csswg-drafts] [css-grid-2] Allow minmax where max wins over min

From: fantasai via GitHub <sysbot+gh@w3.org>
Date: Wed, 15 Mar 2017 20:08:49 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-214510655-1489608528-sysbot+gh@w3.org>
fantasai has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-grid-2] Allow minmax where max wins over min ==
> Minmax would be *far* more useful if the max was always respected. Using grid to have a max-width content area but a full-width background is actually really hard without this feature. For a current use case I need to use
> `grid-template-columns: 1fr repeat(4, minmax(20%, 250px)) 1fr;`
> Being able to use viewport units and percentage units as a minimum value while specifying a pixel maximum would make so much sense. Otherwise I'll have to make do with using a pixel minimum, which will means my fr margins will take up no space at smaller viewports, so i'll have to add tedious media queries.
> I realize i can set a percentage value and a max-width on the content itself and then set `grid-template-columns to  1fr repeat(4, auto) 1fr` but this is far from ideal.
> I've been trying a lot of different ways to achieve the same layout. Please consider changing this.

This is a perfectly reasonable use case, but since min wins over max in CSS in general, we weren't able to solve it by inverting the priority (see [response on www-style](https://lists.w3.org/Archives/Public/www-style/2017Feb/0021.html). So we need some other, syntactically-different, solution. Suggestions welcome.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1102 using your GitHub account
Received on Wednesday, 15 March 2017 20:09:25 UTC

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