Brief   Full   Jump  

Small
Medium
Large

Teal
High contrast
Bluish
Black

Sans-serif
Serif
Monospaced
Close
d
?
Styles

[css-grid] minmax max value

2 messages.

[css-grid] minmax max value
Ollie Williams   Tue, 04 Oct 2016 13:13:33 +0000

www-style > October 2016 > 0076.html

Received on Thursday, 6 October 2016 14:09:25 UTC

Show in list: by dateby threadby subjectby author

Link to this message in this page.

Sent to: www-style@w3.org.

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.
Re: [css-grid] minmax max value
fantasai   Thu, 2 Feb 2017 14:36:51 -0500

www-style > February 2017 > 0021.html

Received on Thursday, 2 February 2017 19:37:24 UTC

Show in list: by dateby threadby subjectby author

Link to this message in this page.

Sent to: oliverwilliams345@gmail.com, www-style@w3.org.

On 10/04/2016 09:13 AM, Ollie Williams wrote: > 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. Hi, We think your use case is totally valid, but, unfortunately at this point the only way to solve it is to nest elements. Inverting the priority of min and max constraints would mean other use cases aren't handled--and since it would also be inconsistent with the way min-width overrides max-width, we are forced to conclude that this change shouldn't be made. I hope we someday have a way to invert the priority, but at the moment I can't think of a way to express that in an elegant way. ~fantasai and TJ