RE: [css-grid] Varying-width Grids

> Ah, I misinterpreted "first item" to mean "first grid item", not "first item in the list from earlier in this email".
> In that case, I'm still not sure what it really means, or how it impacts on this use-case.
> 
> > My interpretation of this first issue is that you can't have the equivalent of "columns: 500px" in CSS Grid.
> > Optimally, I think we want something like "columns: minmax(500px, 1fr)" or something along the lines I proposed in my previous mail.
> 
> You can also do this today.

Really? That's neat! I may have missed it when implementing the spec, but I've no idea how you would achieve this. Could you write an example? Just to be sure, here's a more exhaustive problem: 

 .grid { 
  display: grid; 
  width: calc(100% + 10px); 
  justify-content: distribute;
 }
 .grid-item {
  width: 290px;
  margin-right: 10px;
 }

>From there, we would like the grid to implicitly get as much columns as possible in the grid with the constraint that the columns should have a breadth of at least 300px. With my proposal, that would be

 .grid { 
  grid-auto-flow: row; 
  grid-auto-columns: minmax(300px, 1fr);
  grid-auto-columns-mode: always;
 }

I believe without the proposed "grid-auto-columns-mode: always" you would end up with a single column all the time, even if the grid is 600px wide or more.

Received on Tuesday, 7 October 2014 20:33:00 UTC