W3C home > Mailing lists > Public > www-style@w3.org > January 2013

Re: min-content/max-content computation WAS: [css3-flexbox] Does "width" property on a flex-item affect its used value of "min-width:auto"?

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Mon, 7 Jan 2013 11:22:05 -0800
Message-ID: <CALRQH78-h9B7O9dU0GM_pWHkSuavUu2=J3+5nO3yLS1BxJN_0g@mail.gmail.com>
To: Ojan Vafai <ojan@chromium.org>
Cc: Daniel Holbert <dholbert@mozilla.com>, Tab Atkins <tabatkins@google.com>, fantasai <fantasai@inkedblade.net>, Elliott Sprehn <esprehn@chromium.org>, www-style list <www-style@w3.org>
On Mon, Jan 7, 2013 at 10:51 AM, Ojan Vafai <ojan@chromium.org> wrote:

> Ugh. I spoke too soon. I went to fix this and realized that this is a more
> general problem than just the flexbox issue. There are a couple questions
> that are not clearly spelled out in the spec when you specify both
> min-width and width.
>
> <style>
> .container {
>     min-width: min-content;
>     width: 100px;
>     height: 40px;
>     background-color: blue;
> }
> .child {
>     display:inline-block;
>     height: 20px;
>     width: 200px;
>     background-color: pink;
> }
> </style>
>
> <div class=container>
>   <div class=child></div>
> </div>
>
> <div class=container>
>   <div class=child>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</div>
> </div>
>
> 1. Should container always always be 100px or should min-content override
> it?
> 2. Should the min-content on the container use the child's min-content or
> it's 200px width?
>
> Testcase:
> https://bug-106143-attachments.webkit.org/attachment.cgi?id=181530
> Screenshot in IE9, FF17 and Chrome tip of tree:
> https://bug-106143-attachments.webkit.org/attachment.cgi?id=181529
>
> I can see valid arguments for either of the three existing behaviors.
>
>
>
min-content on the container should use 200px in this case.

But only if you will add this:

.child {
    display:inline-block;
    height: 20px;
    width: 200px;
    background-color: pink;
    min-width:min-content; /* <<<< this <<<<< */
}

then container shall contain .child content in full (without any overflow).


-- 
Andrew Fedoniouk.

http://terrainformatica.com
Received on Monday, 7 January 2013 19:22:33 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:04 GMT