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

Re: [css3-regions][css3-exclusions][css3-gcpm] Plan B

From: Alan Stearns <stearns@adobe.com>
Date: Mon, 9 Jan 2012 14:53:35 -0800
To: "Tab Atkins Jr." <jackalmage@gmail.com>, Håkon Wium Lie <howcome@opera.com>
CC: "www-style@w3.org" <www-style@w3.org>
Message-ID: <CB30AFEF.A2EF%stearns@adobe.com>
On 12/28/11 9:44 AM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:

> On Wed, Dec 28, 2011 at 8:25 AM, Håkon Wium Lie <howcome@opera.com> wrote:

>> To use regions, the code is slightly longer:
>> 
>>  .article { columns: 3 } /* or better: a width in ems */
>>  img { column-span: 2; width: 100% }
>>  article::region(1) {    /* selects column 1 */
>>    column-span: 2;
>>    float: top;
>>    visibility: collapse; /* so that column 2 moves in */
>>    height: 3em;          /* or something */
>>  }
>> 
>> But still only seven lines compared to the 20 or so lines in the
>> grid-based syntax (not counting markup). As for readability, others
>> should judge, but personally I find the compact code easier to read.
> 
> I'm glad you find that readable, but it's completely opaque to me.

It took me a while to puzzle through this, too - thanks for the line-by-line
explanation. Personally I find the article::region(1) styling strangely
indirect. I am assuming that if the article paginates the spanning column
gets repeated. That could be fixed by making the selector
article::column(1,1). I also find it a bit odd that the article specifies
three columns but gets a fourth by virtue of visibility:collapse. Can I
style article::column(4) when article has columns set to 3?

I do like the idea of column selectors, but I think there will be quite a
few issues to work through with positioning and changing such properties as
width and height for individual columns. Tab's mentioned column balancing,
but I'm also concerned with how columns are sized and positioned to begin
with. Consider your overlapping case:

article {
  columns: 15em;
}
article::region(1-3) {
  height: 15em;
}
article::region(2-3) {
  margin: 4em 0 0 -4em;
}

The overlapping columns would fit in an available width of 44em, but would
the multicol algorithm from 3.1 [1] lay out less than three columns in a
44em space before moving them into place? The multicol implementations I've
worked on have had a difficult enough time determining the number and width
of columns without considering the result of moving or resizing individual
columns. I am more comfortable specifying where elements should display
directly, rather than using offsets from a calculation that isn't the end
result.

[1] http://www.w3.org/TR/css3-multicol/#the-number-and-width-of-columns

Thanks,

Alan
Received on Monday, 9 January 2012 22:54:15 GMT

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