W3C home > Mailing lists > Public > public-css-archive@w3.org > September 2016

Re: [csswg-drafts] [css-grid] Implied Minimum Size of Grid Items

From: Manuel Rego Casasnovas via GitHub <sysbot+gh@w3.org>
Date: Thu, 08 Sep 2016 09:12:50 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-245539645-1473325967-sysbot+gh@w3.org>
Let's see if I'm understanding the last comment. :smile:

Coming back to one of the examples discussed, a grid with a fixed 
track of 20x20:
```html
  <div style="display: grid; grid: 20px / 20px; width: 20px; height: 
20px; border: thick solid; font: 50px/1 Monospace;">
    <div style="background: magenta;">item</div>
  </div>
```

It seems to me that the behavior we're looking for is that the item is
 sized to 20x20, and the rest of the text overflows. So it could be 
something like in the following picture:
![Expected output for previous example: a 20x20 magenta block with a 
black 
border](https://cloud.githubusercontent.com/assets/11602/18343013/c161686a-75b1-11e6-91ad-1aa4f10fb933.png)

And that's the default behavior as `align|justify-items` is `stretch` 
by default.

However, if `align|justify-items` is `start` the expected behavior 
would be like the next picture:
![Expected output with align|justify-items: a magenta block filling 
the whole text (bigger than 
20x20)](https://cloud.githubusercontent.com/assets/11602/18343332/388376bc-75b3-11e6-8a2f-1538b4a6f5dd.png)

If I'm getting it right then we might need to update the spec in a few
 places:
* [6.2. Grid Item 
Sizing](https://drafts.csswg.org/css-grid/#grid-item-sizing)

  > Note: The auto value of min-width and min-height affects track 
sizing
  > in the relevant axis similar to the flexbox behavior on flex items
 in the main axis.

  Shouldn't say in the "cross axis"?

* [6.6. Implied Minimum Size of Grid 
Items](https://drafts.csswg.org/css-grid/#min-size-auto)

  > (The effect is analogous to the automatic minimum size imposed on 
flex items in their main axis.)

  Again "cross axis"?

  > However, if the grid item spans only grid tracks that have a fixed
 max track sizing function,
  > its automatic minimum size in that dimension is further clamped to
 less than or equal to
  > the size necessary to fit its margin box within the resulting grid
 area (flooring at zero).

  Does this apply in both `stretch` and `start` case?



-- 
GitHub Notification of comment by mrego
Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/283#issuecomment-245539645 
using your GitHub account
Received on Thursday, 8 September 2016 09:12:57 UTC

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