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

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

From: Mats Palmgren via GitHub <sysbot+gh@w3.org>
Date: Thu, 22 Sep 2016 00:21:29 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-178493382-1474503687-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:30:23 UTC