W3C home > Mailing lists > Public > www-style@w3.org > February 2012

Re: [css3-flexbox] ED updated: algorithms and 'flex' property

From: Tony Chang <tony@chromium.org>
Date: Tue, 28 Feb 2012 15:03:17 -0800
Message-ID: <CAL-=4P2FKe-7FPeNs+0RS=VS399K5cuVaw=u3So-8Zff99FivQ@mail.gmail.com>
To: Alex Mogilevsky <alexmog@microsoft.com>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, "www-style@w3.org list" <www-style@w3.org>
On Tue, Feb 28, 2012 at 2:38 PM, Alex Mogilevsky <alexmog@microsoft.com>wrote:

> Here is an example:
>
> Suppose you have some images as flex items:
>
>        .filmstrip { display:flexbox; }
>        .filmstrip > img { flex:1 auto; }
>
> that says "use image intrinsic size as preferred size, let it grow if
> space allows but don't shrink". Sounds useful?
>
> Now, what if the image doesn't have an intrinsic size and it has a size
> that is set in content, perhaps by a server that you don't own?
>
>        <img class="thumbnail" src="img1001.jpg" style="width:200px;
> height:150px">             <img class="thumbnail" src="img1001.jpg"
> style="width:150px; height:200px">             <img class="thumbnail"
> src="img1001.jpg" style="width:180px; height:180px">             ...
>
> The specified width and height are very relevant. Then we have to be able
> to use it.
>

What if you wanted to do intrinsic sizing to override the inline styles? In
other words, you want 'flex: 1 auto' to force a preferred size of auto.  It
might work to do something like 'width: auto !important', but that wouldn't
be necessary if auto for preferred size meant auto.


> On the other point, if 'auto' is not the best name for "use specified
> width/height", we could come up with a different keyword. But... 'auto' is
> already a valid value for 'width', it has to mean something here, if we use
> a different keyword we have to define what it is (or isn't). I think 'auto'
> is not that bad for the purpose...


I guess I find this confusing because 'auto' already has a meaning when
talking about a size, but you're proposing that we give it a different
meaning for preferred size.

If we have to keep this fallback behavior, we should just use a different
keyword.  The example you provided doesn't seem like it would be that
common, which is why I would be in favor of not having a fallback option.

tony
Received on Tuesday, 28 February 2012 23:11:47 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:51 GMT