W3C home > Mailing lists > Public > www-style@w3.org > March 2015

Re: [css-multicol][css-sizing] Intrinsic Sizes of Multi-column Elements

From: fantasai <fantasai.lists@inkedblade.net>
Date: Wed, 25 Mar 2015 16:32:34 -0700
Message-ID: <55134592.50607@inkedblade.net>
To: Rossen Atanassov <Rossen.Atanassov@microsoft.com>, "www-style@w3.org" <www-style@w3.org>
On 03/25/2015 03:58 PM, Rossen Atanassov wrote:
>> -----Original Message-----
>> From: fantasai [mailto:fantasai.lists@inkedblade.net]
>> Sent: Wednesday, March 18, 2015 9:40 PM
>>
>> Here's my suggestions:
>>
>>
>> col-count only
>>     min = #cols * min-content [of contents]
>>     max = #cols * max-content
>>     Implemented by: Firefox, Chrome, IE
>>
>>     Rationale:
>>       Width of columns is totally flexible,
>>       so pick a size that respects min/max-content
>
> Agree on this one with the gap space added to the above sum.

Yeah, I'm ignoring gaps atm, since it's obvious to include them,
but it complicates the formulas we're discussing. :)

>> col-width only
>>     min = min(col-width, min-content)
>>     max = col-width
>>     Implemented by: Firefox, IE
>>
>>     Rationale:
>>       Widest possible column is column-width*2-ɛ.
>>       But if columns happen to be column-width (as requested),
>>       then any content outside that overflows and is clipped.
>>       It makes sense that the column-width becomes a limit
>>       on the content's size contribution.
>>
>>       The narrowest possible column is zero. If the min-content
>>       is less than the column-width, then we can become that
>>       small.
>
> Almost agree. Having a MAX < MIN looks weird. The same problem
> with gaps missing as the previous.

What makes you think max < min? It's the other way around for sure.

>> col-width + col-count
>>     min = min(col-width, min-content)
>>     max = col-count * col-width
>>     Implemented by: Firefox, IE
>>
>>     Rationale:
>>       The layout as the container gets narrower (fewer columns)
>>       approaches the col-width only case (reduce columns as
>>       width reduces in order to keep each column >= col-width),
>>       so it makes sense to have the same behavior.
>>
>>       The multi-column spec wanted column-width * column-count,
>>       when both were defined, to be the preferred width, and
>>       the implementations reflect this. Authors would probably
>>       prefer that shrink-to-fit sizing landed on this answer
>>       for maxed-out cases as well.
>
> Agree with this one but did drop the column-count from the calculation of min by mistake?

No, because when you have both a col-width and a col-count,
you drop the column counts as the multicol gets narrower.
I.e. below col-count*col-width, a multicol behaves the same
as just having col-width.

> http://codepen.io/anon/pen/ogmQwp
> Also, the same problem about max being less than min as above.
>
>> col-width + height
>>     min = used col-count == 1 ?
>>             min-content : column-width * used column count
>>     max = column-width * used column count
>>     Implemented by: Nobody
>>
>>     Rationale:
>>       Any other answer results in overflow, which no intrinsic
>>       size should ever result in.
>>
>>       Also this case hits a number of real-world use cases,
>>       and they would like the max-content size to be as described.
>
> The rational seems reasonable. Is there a reason we would ignore
> the size of the column in case column-count==1 ? The following
> seems more appropriate to me:
>   min = used col-count == 1 ? min(min-content, column-width)
>         : min(min-content, column-width) * used column count

You mean, just
     min = min(min-content, column-width)
? :)

Since a multicol can get narrower than the column width without
overflowing (which is especially an important consideration on
narrow screens), its intrinsic minimum should reflect that
behavior as well.

~fantasai
Received on Wednesday, 25 March 2015 23:33:02 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:30 UTC