====== CSS Region Templates ====== //This is a collection of ideas spawned from discussions at TPAC2011. Not very organized yet. This may evolve into zero or more new spec modules. May overlap with existing modules too.// //Related: [[Page View]]//\\ //Related: [[Fragments, Columns, Regions, Pages]]// ===== Goals ===== * Define a declarative way to generate regions or pages based on (a) amount of content in paged presentation and (b) some description of page design * Make it easy to produce a simple paginated view without script * Provide a way to generate pages with different layout, based on document design and available content * Have appropriate extensiblity to enable custom design and custom logic for page generation ===== Ideas ===== ==== 1. Element-per-region ==== Peter's template design [1] relies on region functionality where a region consumes exactly one element from flow. This is close to what would have happen if there was a forced break after each element, but region auto sizing doesn't work that way now. This calls for a special kind of region, and it will work better than manipulating with forced breaks. How about this: **region-type**: page | column | box | slot | frame | auto (initial: auto) Region types have this meaning: * **page** - paginate the flow ("region-overflow:break"); "break-*:page" treats region as a page * **column** - same as page, but "break-*:column" moves to next region and content can be balanced (TBD how to tell which columns are on same page) * **box** - consuming one element at a time from the flow. No pagination, layout works as if the element from flow was the only child of the region * **slot** - same as 'box' but the element from flow replaces the region. Useful for incompatible containers (e.g. region is

and element is

). TBD how region and content properties are merged. * **frame** - consume all of the flow content, layout as if it was actual content * **auto** - page (if content doesn't fit) or frame (if it does) - as defined currently for "region-overflow:auto" This would replace 'region-overflow' property. This idea is confusing for most who asked about it. It may still make sense if one property can solve multiple issues, but it will need better naming then and better description. There are other ideas on the way, this to be updated ==== 2. 'flow-into': element vs. content ==== The issue of nested containers in regions ("region-type:box" vs. "region-type:slot") can also be addressed by named flow source element sending its content to the flow -- by adding a flow property to control that, or a new value for 'display' property **"display:content"**:
Lorem Revisited
Then if template has a region for "title" flow

it will not get an extra div in the heading. This can solve other issues of regions adding hierarchy that gets in the way: * Combine multiple
    elements in a flow and merge numbering * Remove semantic grouping elements which don't have rendering (and allow content to be laid out by parent layout, e.g. grid) Note that "display:content" can have effect when applied to any element (not necessarily related with flows and regions) -- it has the same effect as if the element would be replaced in the DOM tree with its content. And of course this is a way to solve the problem of