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

MatsPalmgren has just created a new issue for 
https://github.com/w3c/csswg-drafts:

== [css-grid] Stretching image grid items in both dimensions ==
I'm wondering about how we should stretch grid items that has
an intrinsic ratio, such as images.  The Grid spec just refers to
css-align which says:
https://drafts.csswg.org/css-align-3/#justify-self-property
"the stretch keyword sets the box’s used size to the length necessary
to make its outer size as close to filling the alignment container
as possible while still respecting the constraints imposed by
min-height/min-width/max-height/max-width."

which I think means that having 'stretch' in both dimensions
will resize the image to fill the grid area **without respecting
the image aspect ratio**.  I think this is a rather unfortunate
default behavior for Grid.

Some background; this topic was discussed for flex items here:
https://lists.w3.org/Archives/Public/www-style/2012Oct/0781.html
where everyone seems to agree that respecting the ratio is desirable,
but for various flex layout specific reasons, this could not be
achieved and it was decided to ignore the ratio (IIUC).

As far as I can tell, those reasons do not apply to Grid, so I see
no reason why we can't respect the ratio when stretching grid items
in both dimensions.

I think web authors generally prefer to preserve aspect ratios,
so that's what I think we should do for grid items.

Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/523 using your GitHub 
account

Received on Thursday, 22 September 2016 00:21:41 UTC