You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>This module describes how to define pagination templates in CSS. In CSS 2.1 content displayed on-screen is assumed to be a single continuous canvas. Pagination templates provide a mechanism for a 'paginated' experience that applies to on-screen presentation as well as printed media. Pagination templates describe the layout of pages in which content is displayed as the user moves from page to page on screen or prints the document content. When content is laid out using pagination templates, pages are generated as needed to accommodate all the content.
80
80
81
+
<divclass="issue-marker wrapper">
81
82
<divclass="issue-marker"><divclass="issue-details">The draft as it stands requires pagination to present the repeated template layouts. Other methods of repeating template layouts to accommodate content might be specified, but the draft would need to be reviewed to remove all reliances on paged displays.</div></div>
83
+
<divclass="issue-marker"><divclass="issue-details">The terms 'template' and 'page' are overloaded in CSS, but they are the words that most clearly describe the concept. Some alternates for the main @ rule: template, page-template, view-template, page-master, master-template, master. Other suggestions are welcome, but only if they are more helpful than onelook.com (which suggested "Captain Submarine").</div></div>
84
+
</div>
82
85
83
86
<p>Pagination templates consist of anonymous boxes called slots created by CSS to contain content. Layouts that use pagination templates mainly determine the size of these slots from the template definition instead of the size of their content. When content does not fit into a template slot, additional pages are created with more slots to contain the overflow content.
84
87
85
88
<p>Multiple pagination templates can be defined for a given document. A paginated element can use a single template or select from a set of templates each time a new page needs to be generated. Which template is used for a given page can be defined by a selector or by choosing a template based on available content. Elements can further constrain the applicable template set by listing a subset of templates that apply.
86
89
87
-
<divclass="issue-marker"><divclass="issue-details">The terms 'template' and 'page' are overloaded in CSS, but they are the words that most clearly describe the concept. Some alternates for the main @ rule: template, page-template, view-template, page-master, master-template, master. Other suggestions are welcome, but only if they are more helpful than onelook.com (which suggested "Captain Submarine").</div></div>
88
-
90
+
89
91
<h3id="placement">Module Interactions</h3>
90
92
91
93
<p>This module uses named flows and region chains defined in [[CSS3-REGIONS]].
@@ -216,35 +218,37 @@ <h2 id="templates-and-slots">Pagination Templates and Slots</h2>
<p>Multiple templates can be defined for a single document. An element that uses pagination templates either selects a template from the entire document set or a subset defined by the 'template-set' property. Each page view created uses a single template. This template can be chosen from the applicable set using a selector, by matching content to display using the 'required-flow' or 'available-content' declarations, or just taking the first template found.
221
+
<p>Multiple templates can be defined for a single document. An element that uses pagination templates either selects a template from the entire document set or a subset defined by the 'template-set' property. Each page view created uses a single template. This template can be chosen from the applicable set using a selector, by matching content to display using the 'required-flow' or 'available-content' declarations, or just taking the last template found.
220
222
221
223
<divclass="issue-marker"><divclass="issue-details">The following section describes selecting templates with several mechanisms (selectors and declarations, and presumably @template rules could be scoped by media queries). An alternative could be to define all selection mechanisms like a media query, where all of the selection mechanisms are outside the declaration block. Attempting to define template rejection rather than selection might also prove fruitful.</div></div>
222
224
223
225
<divclass='example'>
224
-
<p>In this example the divs are paginated using the first template found from the set of templates that apply to the div. The first div uses template one, the second div uses template two, and the third div uses template three.
226
+
<p>In this example the divs are paginated using the last template found from the set of templates that apply to the div. The first div uses template three, the second div uses template two, and the third div uses template one.
<h3id='ordered-templates'>Selecting Templates by Page Order</h3>
242
244
243
245
<p>Selectors such as :first can be used on a pagination template to define a separate template for pages that match the selector.
244
246
247
+
<divclass="issue-marker wrapper">
245
248
<divclass="issue-marker"><divclass="issue-details">Should :left and :right be allowed with a way of displaying more than one page at a time in a viewport? Should :nth(x) selectors be allowed?</div></div>
246
249
247
250
<divclass="issue-marker"><divclass="issue-details">Describe how @template rules cascade with names and selectors (or how they do not cascade, if that's preferable).</div></div>
251
+
</div>
248
252
249
253
<divclass='example'>
250
254
<p>Any of the side-by-side two-article examples from the previous section could have an @template :first {} rule that defined a fancy layout for the first page.
@@ -271,7 +275,7 @@ <h3 id='ordered-templates'>Selecting Templates by Page Order</h3>
271
275
272
276
<h3id='selection-from-required-flows'>Selecting Templates from Required Flows</h3>
273
277
274
-
<p>The 'required-flow' property can be used in a pagination template to list named flows that must still have content in order for the template to be used. If more than one template has a 'required-flow' value that matches the remaining flow content, the first template that matches will be used.
278
+
<p>The 'required-flow' property can be used in a pagination template to list named flows that must still have content in order for the template to be used. If more than one template has a 'required-flow' value that matches the remaining flow content, the last template that matches will be used.
275
279
276
280
<divclass='example'>
277
281
<p>"Continued on" layout.
@@ -287,6 +291,20 @@ <h3 id='selection-from-required-flows'>Selecting Templates from Required Flows</
287
291
body { overflow-style: paged-x; }
288
292
.lead-story { flow-into: lead-flow; }
289
293
.related-article { flow-into: related-flow; }
294
+
@template related {
295
+
required-flow: related-flow;
296
+
@slot content {
297
+
flow-from: related-flow;
298
+
column-width: 20em;
299
+
}
300
+
}
301
+
@template lead {
302
+
required-flow: lead-flow;
303
+
@slot content {
304
+
flow-from: lead-flow;
305
+
column-width: 20em;
306
+
}
307
+
}
290
308
@template continued-on:first {
291
309
@slot lead {
292
310
flow-from: lead-flow;
@@ -303,20 +321,6 @@ <h3 id='selection-from-required-flows'>Selecting Templates from Required Flows</
0 commit comments