W3C home > Mailing lists > Public > www-style@w3.org > October 2010

Re: [css3-multicol] propose "column-width:minimum"

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 15 Oct 2010 08:32:31 -0700
Message-ID: <AANLkTikf=S5ES7caJw27ii-apaWxEisERrCXsFvdQY3U@mail.gmail.com>
To: shelby@coolpage.com
Cc: www-style@w3.org
On Fri, Oct 15, 2010 at 3:26 AM, Shelby Moore <shelby@coolpage.com> wrote:
> Another thread raised the issue of whether the CSS column layout model is
> sufficiently generalized:
>
> http://lists.w3.org/Archives/Public/www-style/2010Oct/0280.html
>
> Afaics (so far) it is, because the model does not preclude later
> specifying how to to do variable column widths per column, and perhaps
> even overflow into other elements via the proposed "overflow:" at the
> above link (thanks to Brad Kemper for the idea on extending and re-using
> overflow setting, suppose that is what Tab Aktins had in mind).
>
> In addition to the proposed "column-height:constrain" default at the above
> link, there is one more setting lacking in the current model which I think
> is going to build bad inertia, and thus I think we should correct it asap.
>
> Imagine the case where the content of the multi-column element contain
> block elements (which may be intermixed with inline), e.g.:
>
> <div style='column-width:250px'>
>   Unwrapped Snicker bar at bottom of the swimming pool.
>   <div>Something there</div>
>   <span style='display:inline-block'><img src='person.jpg'/>Name</span>
>   ...etc...
> </div>
>
> That will be common when columinating a large set of logically similar
> items (e.g. in my case user profile summaries with a thumbnail photo).
>
> The problem is that in that case, the page designer may be striving for
> "give me as many columns, for which my content will fit, within the 250px
> space I have allocated".  So in current spec the column-width as
> hard-coded to specific length, is not what the designer needs. And
> column-count isn't appropriate either. What the designer needs is for the
> browser layout engine to analyze the block elements in the content and
> determine the "minimum" column-width that won't clip the content. This is
> a complex calculation which includes the text wrapping settings, etc..
>
> Thus I propose "column-width:minimum".
>
> Please let me know if that description of the problem is unclear,
> insufficient, or incorrect.

You don't actually want "as many columns for which my content will
fit".  You want "as many columns as will look good with my content".

The former is doable (it's just the 'min-content' keyword, currently
supported only by Firefox under a prefix), but it'll be ugly, because
the minimum content size is just the width of the longest word or
replaced element.

The latter is not doable, because it involves aesthetic judgements of
balance and personal taste.  You can probably fake it, though, with a
combination of a sensible min-width (to prevent things from shrinking
*too* small), plus a "width:min-content" rule to ensure that the
column doesn't get smaller than the largest word / replaced element.

~TJ
Received on Friday, 15 October 2010 15:33:25 GMT

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