Skip to content

Commit ad53e78

Browse files
committed
grid spec update in progress; current comments are incorporated
1 parent 4c78e15 commit ad53e78

1 file changed

Lines changed: 81 additions & 79 deletions

File tree

css3-grid/overview.src.html

Lines changed: 81 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<head>
55
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
66
<title>CSS Grid Positioning Module Level 3</title>
7-
<link rel="stylesheet" type="text/css" href="default.css">
7+
<link rel="stylesheet" type="text/css" href="../default.css">
88

99
<style type="text/css">
1010
.cols { width: 500px; height: 200px; background: #fff; position: relative; border: solid 10px blue; margin: 0.5em 2em 1em 0; font: bold 14px/19px Arial, sans-serif }
@@ -377,59 +377,17 @@ <h4>Table</h4>
377377
<p class="issue">Definition of a grid for a table is only meaningful if there is
378378
something that can use it. Currently there are no table floats. Should there be?
379379
Something like &quot;float:top left table; float-offset:2gr 4gr&quot; would use the table
380-
grid. Is there a use case for such floats?</p>
380+
grid. Is there a use case for such floats? There is still absolute positioning
381+
that can target at table of course...</p>
381382

383+
<h4>Viewport</h4>
384+
<p>Viewport always defines a single-cell grid with the size of the viewport. </p>
382385
<h4>Priority
383386
of explicit grid definition</h4>
384387

385388
<p>If explicit grid properties grid-columns or grid-rows are
386-
specified on an element with an implicit grid the explicit properties have
389+
specified on an element with an implicit grid, the explicit properties have
387390
priority.</p>
388-
<p>&nbsp;</p>
389-
<p class="todo">editing work in progress... continue editing from here down...</p>
390-
391-
<h2>Grid container</h2>
392-
393-
<p>Using grid does not require any new rules on how the
394-
positioning container is determined. When grid units are used with all
395-
applicable sizing positioning methods, the grid is always taken from the
396-
applicable containing block (which is found as defined as defined in CSS2.1
397-
section 10.1).</p>
398-
399-
<p>In this example, div1 is the positioning parent and
400-
therefore grid of div1 is used for positioning:</p>
401-
402-
<div class="example">
403-
<pre>&lt;style&gt;
404-
<strong>.div1 { position:absolute; grid-columns:4.5em (1em 4.5em); }</strong> /* this grid is used */
405-
.div2 { columns-width:10em; column-gap:1em; }
406-
img { position:absolute; left:2gr; width:3gr; }
407-
&lt;/style&gt;
408-
&lt;div class=&quot;div1&quot;&gt;
409-
&lt;div class=&quot;div2&quot;&gt;
410-
&lt;img /&gt;
411-
&lt;/div&gt;
412-
&lt;/div&gt;
413-
</pre>
414-
</div>
415-
416-
<p>However in the next example, grid of div2 is used by the float, because it is
417-
the float&#39;s containing block:</p>
418-
419-
<div class="example">
420-
<pre>&lt;style&gt;
421-
.div1 { position:absolute; grid-columns:4.5em (1em 4.5em); }
422-
<strong>.div2 { columns-width:10em; column-gap:1em; }</strong> /* this grid is used */
423-
img { float:left; float-offset:2gr; width:3gr; }
424-
&lt;/style&gt;
425-
&lt;div class=&quot;div1&quot;&gt;
426-
&lt;div class=&quot;div2&quot;&gt;
427-
&lt;img /&gt;
428-
&lt;/div&gt;
429-
&lt;/div&gt;
430-
</pre>
431-
</div>
432-
433391

434392

435393
<h2>Grid units</h2>
@@ -530,20 +488,58 @@ <h3>Applicability of grid units</h3>
530488
in the direction of line progression (horizontal in layout with horizontal
531489
lines).</p>
532490
<p>Grid units never apply to inline elements, including inline blocks.</p>
491+
492+
493+
<h3>Grid container</h3>
494+
495+
<p>Since separate grids can be defined on nested elements, it must be defined
496+
which grid is referred to for every use of &#39;gr&#39; unit.</p>
497+
<p>For all cases where &#39;gr&#39; unit is applicable the grid is taken from the
498+
containing block (which is found as defined as defined in CSS2.1
499+
section 10.1).</p>
500+
501+
<p>In this example, div1 is the positioning parent and
502+
therefore grid of div1 is used for positioning:</p>
503+
504+
<div class="example">
505+
<pre>&lt;style&gt;
506+
<strong>.div1 { position:absolute; grid-columns:4em repeat(1em 4em); }</strong> /* this grid is used */
507+
.div2 { columns-width:10em; column-gap:1em; }
508+
img { position:absolute; left:2gr; width:3gr; }
509+
&lt;/style&gt;
510+
&lt;div class=&quot;div1&quot;&gt;
511+
&lt;div class=&quot;div2&quot;&gt;
512+
&lt;img /&gt;
513+
&lt;/div&gt;
514+
&lt;/div&gt;
515+
</pre>
516+
</div>
517+
518+
<p>However in the next example, grid of div2 is used by the float, because it is
519+
the float&#39;s containing block:</p>
520+
521+
<div class="example">
522+
<pre>&lt;style&gt;
523+
.div1 { position:absolute; grid-columns:4.5em (1em 4.5em); }
524+
<strong>.div2 { columns-width:10em; column-gap:1em; }</strong> /* this grid is used */
525+
img { float:left; float-offset:2gr; width:3gr; }
526+
&lt;/style&gt;
527+
&lt;div class=&quot;div1&quot;&gt;
528+
&lt;div class=&quot;div2&quot;&gt;
529+
&lt;img /&gt;
530+
&lt;/div&gt;
531+
&lt;/div&gt;
532+
</pre>
533+
</div>
534+
535+
533536
<h3>Reference point for grid units</h3>
534-
<p class="issue"><strong>ISSUE: </strong>Calculating grid units require a
537+
<p class="issue">Calculating grid units require a
535538
reference point within the grid and direction. This needs a precise definition.
536539
For the same element, grid units for position and size may have different
537540
reference points (but probably not different directions).</p>
538-
<h3>Undefined grid units</h3>
539-
<p>Because of positional nature of &#39;gr&#39; unit it is ambiguous in absence
540-
of position. Also, grid size may not be defined when a grid unit has to be
541-
applied.</p>
542-
<p>In such case values specified in &#39;gr&#39; units are
543-
ignored (set to their initial value).</p>
544-
<p class="issue">Need some examples here. E.g. what happens to &#39;1gr&#39; float in a
545-
multi-column element within a table that is sized to content? Grid size depends
546-
on the float&#39;s size so &#39;gr&#39; should be ignored.</p>
541+
<p class="issue">Define how &#39;gr&#39; is used on in-flow blocks. Is &#39;1gr&#39; generally
542+
equivalent to &#39;100%&#39; there?</p>
547543

548544
<h2>Grid in overflow</h2>
549545
<p>When a measure defined in grid units extends outside the boundaries of grid
@@ -558,11 +554,6 @@ <h2>Grid in overflow</h2>
558554
<li>Otherwise, the last column or row size is repeated </li>
559555
</ul>
560556
</li>
561-
<li>Default grid<ul>
562-
<li>Same as non-repeating pattern: equally spaced lines are added,
563-
separated by the size of the element</li>
564-
</ul>
565-
</li>
566557
<li>Multi-column element<ul>
567558
<li>Additional (gap, column) pairs are added.
568559
<ul>
@@ -577,6 +568,11 @@ <h2>Grid in overflow</h2>
577568
<li>The last column is repeated</li>
578569
</ul>
579570
</li>
571+
<li>Viewport<ul>
572+
<li>Additional lines are added, separated by the size of the
573+
viewport</li>
574+
</ul>
575+
</li>
580576
</ul>
581577
</li>
582578
<li>If overflow is in negative direction<ul>
@@ -586,34 +582,39 @@ <h2>Grid in overflow</h2>
586582
</li>
587583
</ul>
588584

589-
<p class="issue">TODO: example</p>
585+
<p class="issue">Add an example</p>
586+
<p class="issue">How important is an overflow grid? What use cases would suffer
587+
if &#39;gr&#39; is just set to zero in overflow?</p>
590588

591589
<h2>Issues</h2>
592590

593-
<h3>Containing block</h3>
594-
<p>Does a grid (implicit or explicit) add another definition to &quot;containing
595-
block&quot;? It would be great to say No and keep unit definition separate from
596-
choice of sizing/positioning container.</p>
591+
<h3>Grid on shrink-to-fit elements</h3>
592+
<p class="issue">Specifying a grid on an element with shrink-to-fit sizing can
593+
create difficult or unsolvable problems, similar to use percentages within
594+
shrink to fit but even more complicated. Consider ignoring grid definition on
595+
anything shrink-to-fit.</p>
597596
<h3>Additional implicit grid lines</h3>
598-
<p class="MsoNormal"><span style="color:#1F497D">On the implicit grids for
597+
<p class="issue">On the implicit grids for
599598
multi-column elements, it might be useful to have one grid line on the left and
600599
right edge of each column, as well as a single grid line between each pair of
601600
columns. Perhaps doing the same thing for tables, one line on each side of the
602-
border spacing and another at the row/column boundary.<o:p></o:p></span></p>
601+
border spacing and another at the row/column boundary.</p>
603602
<h3>Snap to grid</h3>
604603

605604
<p class="issue">Should there be an option to align flow content to next
606605
available gridline? It opens really cool scenarios. But are they compelling
607606
enough to create a next available notion?</p>
608607

609-
<h3>Default grid</h3>
610-
<p>When a grid unit is used in context where there isn&#39;t an explicit or implicit
611-
grid specified, what should it be? Reaching to nearest parent with a defined
612-
grid may or may not be the right choice. There is an option to give any element
613-
a &quot;default grid&quot; of one cell, but that can make nesting scenarios more
614-
complicated.</p>
615-
<h3>Facing pages</h3>
616-
<p>It must be possible to define different grids for left and right pages</p>
608+
<h3>Undefined grid and notion of &#39;default&#39; grid</h3>
609+
<p class="issue">When a grid unit is used in context where there isn&#39;t an
610+
explicit or implicit grid specified, what should it be? Reaching to nearest
611+
parent with a defined grid may or may not be the right choice. There is an
612+
option to give any element a &quot;default grid&quot; of one cell.</p>
613+
<h3>Page grid</h3>
614+
<p>It must be possible to define different grids for left and right pages. Also,
615+
any page with different dimensions (such as named pages) should be able to
616+
define its own grid. </p>
617+
<p class="issue">Add grid-columns/grid-rows to @page rule</p>
617618
<h3>Named grid lines and cells</h3>
618619

619620
<p class="issue">If grid is used extensively, named grid locations would be
@@ -641,7 +642,8 @@ <h3>Templates in CSS3 Advanced Layout module</h3>
641642
<h2 class="no-num" id=acknowledgments>Acknowledgments</h2>
642643

643644
<p class="MsoNormal">This specification is made possible by input from Håkon
644-
Wium Lie, Steve Zilles, Mike Duggan, Bill Hill, Geraldine Wade, Rikkert Koppes, [to be added].</p>
645+
Wium Lie, Steve Zilles, Mike Duggan, Bill Hill, Geraldine Wade, Rikkert Koppes,
646+
Peter Linss [to be added].</p>
645647
<p>Thanks to Khoi Vinh for the “Yeeaahh!” Example.</p>
646648

647649
<p>&nbsp;</p>

0 commit comments

Comments
 (0)