Re: [csswg-drafts] [css-contain] specified column/row sizes on grid containers should contribute to contain:size

> one question about this, are there other elements that can have an intrinsic size different from zero if they have no contents?

Here's one:

```css
div {
 position: absolute;
 columns: 2 50px;
}
```
> What's the use case for this example? Why someone wants to apply contain: size and have the size of the grid container to be only the fixed tracks?

Maybe because they have only fixed tracks, and they trust the browser to do the math and don't want to (redundantly) define the total size manually?

> For widths it's simple, [...] But for heights [...] we don't have explicit code for that and I'm wondering if it'd be really useful.

I can see the trade-off. It seems to me that it would be useful. If you have some kind of card UI, where each card is laid out with a fixed-size grid, you want to be able to update the content of each card without thrashing the whole layout. You could handle it manually by setting the width / height on each card, but if you have already given sufficient information to calculate that in the form of a fixed sized grid, it would be really nicer to let the browser do the math.

-- 
GitHub Notification of comment by frivoal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2804#issuecomment-400243568 using your GitHub account

Received on Tuesday, 26 June 2018 09:29:31 UTC