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

Re: [css3-regions][css3-gcpm] Thoughts on Plan A and Plan B

From: Håkon Wium Lie <howcome@opera.com>
Date: Wed, 22 Feb 2012 13:37:05 +0100
Message-ID: <20292.57713.540224.612471@gargle.gargle.HOWL>
To: Brad Kemper <brad.kemper@gmail.com>
Cc: David Hyatt <hyatt@apple.com>, "www-style@w3.org Style" <www-style@w3.org>
Brad Kemper (and David Hyatt in between) wrote:

 > >> I completely agree with this approach. In my view, we almost
 > >> have page masters right now, with @page and its related @rules,
 > >> except that they are only masters for margin boxes and size, and
 > >> not the main content area. 

Yes. 

 > >> If we added column-related properties
 > >> to the properties that could be used directly with @page, then
 > >> the simple case of having different column numbers, width, etc.
 > >> per named page (or pseudo-class selected page) would immediately
 > >> be available. 

Yes. Like this, perhaps?

  @page :first { columns: 3 }
  @page { columns: 2 }

Another approach is to center around elements:

  body::first-page { columns: 3 }
  body { columns: 2 }

 > >> If we add to that being able to right rule sets
 > >> with selectors within @page (like you can within @region), then
 > >> you would be able to change fonts, colors, widths, etc. of any
 > >> element based on what page it was in. 

Let's see. We could do:

  @page :first {
    h1 { color: red }
  }

But that gets a little messy when we mix in declarations:

  @page :first {
    columns: 3;
    h1 { color: red }
  }

Any ambiguities?

Or, perhaps:

  @page :first h1 {
    color: red
  }

 > >> If you go one step
 > >> further, and add the ability to create an arbitrary number of
 > >> pseudo-elements per page, then you could use 'content' with them
 > >> to put decorations wherever you want on whatever pages you want,
 > >> not just in the margins. I have proposed '@slot()' for this.

Do you have a pointer to your proposal?

 > >> combining this with regions, and you could have content flow
 > >> from region to region, page to page. You could have your sushi
 > >> column in your example work, by flowing it into a slot that is
 > >> on the title page and the third page, but not the second.

Perhaps like this?:

@page 1, 3 {
  @slot sushi {
     position: absolute;
     top: 0;
     bottom: 0;
     right: 0;
     width: 10em;
  }
}

aside { flowto: sushi }

 > >> Anything that didn't fit in a slot because of page size or other
 > >> constraints would automatically go to the next available page
 > >> with the same 'flow-from'.

 > > Yeah, we are definitely on the same page here. (Haha.) I would
 > > like to see column rules applicable to @page as well as the
 > > ability to define a set of slots for the page that can then be
 > > regions. The placement of the slots should be achievable with
 > > grid layout, floating or positioning.

Here's a floated sushi:

@page 1, 3 {
  @slot sushi {
     float: right; 
     width: 10em;
     height: 100%;
  }
}

Grid, anyone?

 > Exactly my thinking. Cool. 
 > 
 > >> Combine all that with overflow:paged by making the pages it
 > >> generates obey css3-page, and you've got a complete solution.

Obey, in what way?

 > >>> If the CSS Regions spec remains the way it is, though, with
 > >>> explicit elements and scripting being the only way to build the
 > >>> paginated content, then I think we'll have failed. Page
 > >>> masters/templates and automatic generation of regions has to be
 > >>> addressed, and the explicit element requirement needs to be
 > >>> removed.

Indeed.

-h&kon
              Håkon Wium Lie                          CTO °þe®ª
howcome@opera.com                  http://people.opera.com/howcome
Received on Wednesday, 22 February 2012 12:37:42 GMT

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