Re: [css-flexbox] "flex: 1;" does the wrong thing in min-size constraint sizing

On Tue, May 14, 2013 at 4:44 PM, Daniel Holbert <dholbert@mozilla.com> wrote:
> On 05/14/2013 11:12 AM, Tab Atkins Jr. wrote:
>> Proposed solution: we add a new value, provisionally named
>> "dont-shrink-me-bro" until someone comes up with something better.
>> This value sticks around until used-value time, eventually being
>> treated as 'min-content' if the element is sized under a min-size
>> constraint, or 0 otherwise.  This becomes the new value for
>> 'flex-basis' when it's omitted from the shorthand, so "flex: 1;"
>> expands to "flex: 1 1 dont-shrink-me-bro;".
>
> Isn't "0%" exactly the dont-shrink-me-bro value that you're looking for?
>
> Generally, if a piece of content with "height: 0%" is being
> shrinkwrapped, then the 0% height won't have anything to resolve
> against, and so it ends up resolving to auto (effectively min-content)
> instead of 0.
>
> At least, that's how 0% behaves in e.g.:
>   <!DOCTYPE html>
>   <div style="height: 0%; border: 1px solid">foo</div>
> in my local Opera, Chrome, and Firefox installs.

Wouldn't 0% *also* resolve to "auto" for cases where things *were*
"able to flex", but the flexbox didn't have a definite width/height?
Though I suppose this would happen in the layout algorithm, and we
could just *specify* what happens.

If this does end up working, I like using it over a new keyword, not
least because I still can't think of a good name for it.

~TJ

Received on Wednesday, 15 May 2013 17:07:57 UTC