Re: [csswg-drafts] [css-grid] Stretching image grid items in both dimensions

Wrt conclusion stated in https://github.com/w3c/csswg-drafts/issues/523#issuecomment-274928367 ... [here are the minutes](https://lists.w3.org/Archives/Public/www-style/2017Feb/0061.html).

The key excerpt is that three solutions were considered for handling replaced elements:

> 1) Make default sizing intrinsic (could opt into contain with `width`/`height` keywords)
> 2) Make default sizing contain (could opt into intrinsic with `width`/`height` keywords)
> 3) Add sizing options to alignment (Mats's proposal in https://github.com/w3c/csswg-drafts/issues/523#issuecomment-268095890 )

The problem with option 3 is, as described in https://github.com/w3c/csswg-drafts/issues/523#issuecomment-268095890 , that what should be an alignment control devolves into a sizing control, which is objectionable.

This left two options: 1 & 2. Both allow for all of the relevant behavior to be specified, they just differ on the default. Several arguments tilted in favor of option 1:
- François argued (during the break) that upscaling images isn't great, and it's likely people will want to place smaller images into grid areas and use alignment to control their placement.
- There isn't a clear spec yet for how `contain`  sizing would work. (Such a spec would have to consider not just the size of the grid area, but also the impact of min/max/specified sizing properties, so it's not hard but requires some thought.)
- This default would be consistent with block layout, which is familiar to authors.
- This default would be an easy place to start for common modifications like
   - simple alignment (via alignment keywords)
   - constraining the size (while preserving aspect ratio) via `max-size: 100%`
   - stretching to fit via `stretch` (and potentially using `object-fit` to preserve ratio)
   - fitting into the grid area `contain`-style via future keyword, as Mats has requested here

The WG therefore resolved on option 1, and actioned me and Tab to draft up a spec for `contain` as a keyword to `width` and `height`.

@MatsPalmgren Sorry for taking so long to post a proper summary. Please let us know what you think, and if this is acceptable to you. For my part, I am OK with either 1 or 2, but I would have to object to 3.

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

Received on Thursday, 23 March 2017 21:14:20 UTC