1111 rel =dcterms.rights >
1212 < meta content ="CSS Grid Template Layout Module " name =dcterms.title >
1313 < meta content =text name =dcterms.type >
14- < meta content =2013-03-12 name =dcterms.issued >
14+ < meta content =2013-03-13 name =dcterms.issued >
1515 < meta content ="Bert Bos " name =dcterms.creator >
1616 < meta content ="César Acebal " name =dcterms.creator >
1717 < meta content =W3C name =dcterms.publisher >
3838 < h1 > CSS Grid Template Layout Module</ h1 >
3939
4040 < h2 class ="no-num no-toc " id =longstatus-date-3-august-2004 > Editor's Draft
41- 12 March 2013</ h2 >
41+ 13 March 2013</ h2 >
4242
4343 < dl >
4444 < dt > This version:
4545
4646 < dd > < a
47- href ="http://dev.w3.org/csswg/css3-layout/ "> http://www.w3.org/TR/2013/ED-css3-layout-20130312 /</ a >
47+ href ="http://dev.w3.org/csswg/css3-layout/ "> http://www.w3.org/TR/2013/ED-css3-layout-20130313 /</ a >
4848
4949 < dt > Latest version:
5050
@@ -463,6 +463,10 @@ <h3 id=summary-and-use-cases><span class=secno>1.1. </span>Summary and use
463463 < p > Complex pages with multiple regions, where the style of the text does
464464 not only depend on the type of element it comes from, but also on the
465465 region it is displayed in.
466+
467+ < li > Paged displays with complex running headers and footers, e.g., running
468+ headers that are in between parts of the page content, rather than at the
469+ edge of the page.
466470 </ ul >
467471
468472 < p > Once a grid template has been defined, it can also be used to position
@@ -799,13 +803,16 @@ <h3 id=summary-and-use-cases><span class=secno>1.1. </span>Summary and use
799803 differently from other H1s:
800804
801805 < pre >
802- ::slot(*) {
803- font-weight: bold;
804- color: #0C3D5F;
805- font-size: larger }
806- h1::slot(*) {
807- color: crimson;
808- display: run-in }
806+ @region ::slot(*)
807+ {
808+ * {
809+ font-weight: bold;
810+ color: #0C3D5F;
811+ font-size: larger }
812+ h1 {
813+ color: crimson;
814+ display: run-in }
815+ }
809816</ pre >
810817
811818 < p > (For brevity, the example doesn't show the style rules to set the color
@@ -840,7 +847,9 @@ <h3 id=summary-and-use-cases><span class=secno>1.1. </span>Summary and use
840847
841848 < dt > [Method 3]
842849
843- < dd class =issue >
850+ < dd class =issue > [If ‘< a href ="#vertical-align "> < code
851+ class =property > vertical-align</ code > </ a > ’ is generalized to apply to
852+ all blocks, rather than only to table cells, margin boxes and slots:]
844853 < pre > P {height: 20em; vertical-align: bottom}</ pre >
845854 </ dl >
846855
@@ -879,8 +888,9 @@ <h3 id=summary-and-use-cases><span class=secno>1.1. </span>Summary and use
879888 different than if they were on the same line.
880889
881890 < p > With a grid template, we can say that the P has not one, but two flows,
882- a and b; and then we assign the fourth and subsequent SPANs to the
883- “b” flow. (The others automatically go into the default, first flow.)
891+ a and b, the second one positioned below the first; and then we assign
892+ the fourth and subsequent SPANs to the “b” flow. (The others
893+ automatically go into the default, first flow.)
884894
885895 < pre >
886896p {grid: "a" "b"}
@@ -903,6 +913,40 @@ <h3 id=summary-and-use-cases><span class=secno>1.1. </span>Summary and use
903913 inside a grid element. For the moment, there is no such thing.
904914 Suggestions are welcome.
905915 </ div >
916+
917+ < div class =example >
918+ < p > This example uses a < a href ="#page-based-template "> < em > page-based
919+ template</ em > </ a > to create a running header that is not at the top of
920+ the page, but exactly in the middle. We need to define our own page
921+ template for this, because the predefined page template of < a
922+ href ="#CSS3PAGE " rel =biblioentry > [CSS3PAGE]<!--{{CSS3PAGE}}--> </ a > only
923+ has margin boxes along the edge of the page.
924+
925+ < pre >
926+ @page {
927+ grid:
928+ "top-half"
929+ "running-header" 3em
930+ "bottom-half";
931+ chains: top-half bottom-half
932+ }
933+ ::slot(running-header) {
934+ content: "My Magazine - page " counter(page) " - February 2013";
935+ text-align: center;
936+ vertical-align: middle;
937+ border: solid;
938+ margin: 1em 0;
939+ }
940+ </ pre >
941+
942+ < div class =figure >
943+ < p > < img alt ="Image: Example rendering " longdesc =page.desc src =page.png >
944+
945+ < p class =caption > An example of a page rendered with the above page
946+ template. It has the “running header” with the page number right in
947+ the middle of the page.
948+ </ div >
949+ </ div >
906950 <!--=================================================================-->
907951
908952 < h3 id =dependencies > < span class =secno > 1.2. </ span > Dependencies on other
@@ -998,7 +1042,7 @@ <h3 id=dependencies><span class=secno>1.2. </span>Dependencies on other
9981042 </ ul >
9991043
10001044 < p class =issue > Add to the above all the properties that are allowed on
1001- slots (see < a href ="#slot-pseudo "> “The ‘< code
1045+ slots (see < a href ="#slot-pseudo "> “Styling slots: the ‘< code
10021046 class =css > ::slot()</ code > ’ pseudo-element”</ a > ).
10031047
10041048 < p > It has non-normative (informative) references to the following other
@@ -3150,19 +3194,15 @@ <h2 id=slot-pseudo><span class=secno>4. </span>Styling slots: the ‘<code
31503194
31513195 < p > Margins on slots do not collapse, neither with other slots, nor with
31523196 elements inside the slot.
3153-
3154- < p class =issue > Margins aren't really necessary on slots. You can add
3155- ‘< code class =css > .</ code > ’ cells in the grid template to make empty
3156- space.
31573197 <!--=================================================================-->
31583198
31593199 < h2 id =content > < span class =secno > 5. </ span > Slots and the ‘< a
31603200 href ="#content1 "> < code class =property > content</ code > </ a > ’ property</ h2 >
31613201
31623202 < p > The ‘< a href ="#content1 "> < code class =property > content</ code > </ a > ’
31633203 property applies to slot pseudo elements in a similar way as it applies to
3164- elements and other pseudo-elements. In particular, values have the
3165- following meaning:
3204+ normal elements and other pseudo-elements. When applied to slots, values
3205+ have the following meaning:
31663206
31673207 < dl >
31683208 < dt > < dfn id =normal > ‘< code class =css > normal</ code > ’</ dfn >
@@ -3187,12 +3227,7 @@ <h2 id=content><span class=secno>5. </span>Slots and the ‘<a
31873227
31883228 < dd > Renders as the content that is flowed into the slot (with the ‘< a
31893229 href ="#flow0 "> < code class =property > flow</ code > </ a > ’ property, or
3190- because the slot is the < a href ="#default-slot. "> default slot</ a > ). If
3191- the keyword ‘< a href ="#contents0 "> < code
3192- class =css > contents</ code > </ a > ’ appears multiple times in the value of
3193- ‘< a href ="#content1 "> < code class =property > content</ code > </ a > ’, the
3194- second and subsequent occurrences are ignored. (But those occurrences are
3195- still part of the computed value.)
3230+ because the slot is the < a href ="#default-slot. "> default slot</ a > ).
31963231 </ dl >
31973232
31983233 < p > Other values are as defined in < a href ="#CSS3GENCON "
@@ -3202,11 +3237,20 @@ <h2 id=content><span class=secno>5. </span>Slots and the ‘<a
32023237 example of the use of ‘< code class =css > string()</ code > ’ in the value
32033238 of ‘< a href ="#content1 "> < code class =property > content</ code > </ a > ’.
32043239
3205- < p > Even if the value of ‘< a href ="#content1 "> < code
3206- class =property > content</ code > </ a > ’ does not include ‘< a
3207- href ="#contents0 "> < code class =css > contents</ code > </ a > ’ and the content
3208- that is flowed into a slot is thus not rendered, any counters associated
3209- with that content are incremented normally.
3240+ < p class =issue > [This should be moved to < a href ="#CSS3GENCON "
3241+ rel =biblioentry > [CSS3GENCON]<!--{{!CSS3GENCON}}--> </ a > .] Even if the value
3242+ of ‘< a href ="#content1 "> < code class =property > content</ code > </ a > ’ does
3243+ not include ‘< a href ="#contents0 "> < code class =css > contents</ code > </ a > ’
3244+ and the content that is flowed into a slot is thus not rendered, any
3245+ counters associated with that content are incremented normally.
3246+
3247+ < p class =note > Note: as defined in < a href ="#CSS3GENCON "
3248+ rel =biblioentry > [CSS3GENCON]<!--{{CSS3GENCON}}--> </ a > , the keyword ‘< a
3249+ href ="#contents0 "> < code class =css > contents</ code > </ a > ’ may appear
3250+ multiple times in the value of ‘< a href ="#content1 "> < code
3251+ class =property > content</ code > </ a > ’, but the second and subsequent
3252+ occurrences are ignored. (Those occurrences are still part of the computed
3253+ value.)
32103254 <!--=================================================================-->
32113255
32123256 < h2 id =region-based > < span class =secno > 6. </ span > Styling the contents of
@@ -3470,24 +3514,14 @@ <h3 id=vertical-alignment><span class=secno>7.1. </span>Vertical alignment
34703514 than the contents of slot a).
34713515 </ div >
34723516
3473- < div class =note >
3474- < p > Note that < a href ="#CSS3BOX "
3475- rel =biblioentry > [CSS3BOX]<!--{{CSS3BOX}}--> </ a > has a ‘< code
3476- class =css > fill</ code > ’ value for margins, which can also be used to
3477- align content in several cases, although not in the case that the slot
3478- consists of text inserted by ‘< a href ="#content1 "> < code
3479- class =property > content</ code > </ a > ’ or of the content of the < a
3480- href ="#grid-element. "> grid element</ a > itself, because then there is no
3481- element to set a margin on.
3482-
3483- < p > Not also that, if there are one or more margins in the contents of the
3484- slot with a ‘< code class =css > fill</ code > ’ value, the height of the
3485- content fits the height of the slot and thus the ‘< a href ="#top "> < code
3486- class =css > top</ code > </ a > ’, ‘< code class =css > middle</ code > ’ and
3487- ‘< a href ="#bottom "> < code class =css > bottom</ code > </ a > ’ values are
3488- indistinguishable.
3489- </ div >
3490- <!--=================================================================-->
3517+ < p class =note > Note that, if there are one or more margins in the contents
3518+ of the slot with a ‘< code class =css > fill</ code > ’ value (see < a
3519+ href ="#CSS3BOX " rel =biblioentry > [CSS3BOX]<!--{{CSS3BOX}}--> </ a > ), the
3520+ height of the content fits the height of the slot and thus the ‘< a
3521+ href ="#top "> < code class =css > top</ code > </ a > ’, ‘< code
3522+ class =css > middle</ code > ’ and ‘< a href ="#bottom "> < code
3523+ class =css > bottom</ code > </ a > ’ values are indistinguishable.
3524+ <!--=================================================================-->
34913525
34923526 < h3 id =paged > < span class =secno > 7.2. </ span > Breaking grid elements across
34933527 pages or columns</ h3 >
@@ -3986,12 +4020,33 @@ <h2 id=page-templates><span class=secno>8. </span>Page-based grid templates</h2>
39864020 on p. " targetcounter(???, page)</ code > ’ or extend text-overflow from < a
39874021 href ="#CSS3TEXT " rel =biblioentry > [CSS3TEXT]<!--{{!CSS3TEXT}}--> </ a > ?
39884022
3989- < p class =issue > How do you set the ‘< a href ="#vertical-align "> < code
3990- class =property > vertical-align</ code > </ a > ’ property of a slot in a page?
3991- Does the ‘< code class =css > ::slot()</ code > ’ pseudo-element apply?
3992- ‘< code class =css > @page :first :slot(A) {vertical-align:
3993- bottom}</ code > ’
3994- <!--=================================================================-->
4023+ < div class =issue >
4024+ < p > How do you style the slots of page-based template? E.g., with
4025+
4026+ < pre >
4027+ @page :first {
4028+ grid: "a b"
4029+ "c d" }
4030+ @page {
4031+ grid: "a a a"
4032+ "b c d" }
4033+
4034+ ::slot(a) {background: silver}
4035+ </ pre >
4036+
4037+ < p > the background could be set on all “a” slots on all pages. But how
4038+ do you set a background only on the “a” slot of the < em > first</ em >
4039+ page? Maybe we need to extend the page selectors and allow something like
4040+ this:
4041+
4042+ < pre >
4043+ @page :first::slot(a) {background: silver}
4044+ </ pre >
4045+
4046+ < p > A space between the pseudo-class and the pseudo-element could be
4047+ optional.
4048+ </ div >
4049+ <!--=================================================================-->
39954050
39964051 < h2 id =chains > < span class =secno > 9. </ span > Chaining slots: the ‘< a
39974052 href ="#chains0 "> < code class =property > chains</ code > </ a > ’ property</ h2 >
@@ -4711,11 +4766,6 @@ <h4 id=style-the-slots-pseudo-elements><span class=secno>10.2.12.
47114766 < p > ‘< code class =property > Wrap-flow</ code > ’ (from < a
47124767 href ="http://www.w3.org/TR/css3-exclusions/ "> CSS Exclusions and
47134768 Shapes</ a > ) could be useful for slots with negative margins, too.
4714-
4715- < p > ‘< a href ="#content1 "> < code class =property > Content</ code > </ a > ’ might
4716- be useful, but is maybe too powerful: you could write a whole document,
4717- with proper styling, in a style sheet and would only need an empty source
4718- document.
47194769 <!--=================================================================-->
47204770
47214771 < h4 id =select-after-pseudo > < span class =secno > 10.2.13. </ span > Style the
0 commit comments