Skip to content

Commit 89733a1

Browse files
committed
[css3-grid-layout] Wordsmithing the concepts section.
1 parent e3a7531 commit 89733a1

2 files changed

Lines changed: 129 additions & 157 deletions

File tree

css3-grid-layout/Overview.html

Lines changed: 86 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -198,18 +198,15 @@ <h2 class="no-num no-toc" id=contents> Table of contents</h2>
198198
Grid Layering of Elements</a>
199199
</ul>
200200

201-
<li><a href="#grid-layout-box-model-and-terminology"><span class=secno>2.
202-
</span>Grid Layout Box Model and Terminology</a>
201+
<li><a href="#grid-concepts"><span class=secno>2. </span> Core Concepts of
202+
the Grid</a>
203203
<ul class=toc>
204-
<li><a href="#grid-rows-and-columns"><span class=secno>2.1. </span> Grid
205-
Rows and Columns</a>
204+
<li><a href="#grid-lines"><span class=secno>2.1. </span>Grid Lines</a>
206205

207-
<li><a href="#grid-lines"><span class=secno>2.2. </span>Grid Lines</a>
208-
209-
<li><a href="#grid-concepts-tracks"><span class=secno>2.3. </span> Grid
206+
<li><a href="#grid-concepts-tracks"><span class=secno>2.2. </span> Grid
210207
Tracks</a>
211208

212-
<li><a href="#grid-areas"><span class=secno>2.4. </span>Grid Areas</a>
209+
<li><a href="#grid-areas"><span class=secno>2.3. </span>Grid Areas</a>
213210
</ul>
214211

215212
<li><a href="#grid-containers"><span class=secno>3. </span> Grid
@@ -264,7 +261,7 @@ <h2 class="no-num no-toc" id=contents> Table of contents</h2>
264261
and ‘<code class=property>grid-auto-columns</code>’ properties</a>
265262
</ul>
266263

267-
<li><a href="#placing-grid-items"><span class=secno>6. </span>Placing Grid
264+
<li><a href="#placement"><span class=secno>6. </span> Placing Grid
268265
Items</a>
269266
<ul class=toc>
270267
<li><a href="#line-placement"><span class=secno>6.1. </span> Line-based
@@ -478,8 +475,8 @@ <h3 id=adapting-to-available-space><span class=secno>1.2. </span> Adapting
478475
href="#grid-definition-rows"><code
479476
class=property>grid-definition-rows</code></a>’ and ‘<a
480477
href="#grid-definition-columns"><code
481-
class=property>grid-definition-columns</code></a>’ properties on the <a
482-
href="#grid-container"><i>grid container</i></a>, and the ‘<code
478+
class=property>grid-definition-columns</code></a>’ properties on the
479+
<i>grid container</i>, and the ‘<code
483480
class=property>grid-row-position</code>’, ‘<code
484481
class=property>grid-column-position</code>’, ‘<code
485482
class=property>grid-row-span</code>’ and ‘<code
@@ -630,8 +627,8 @@ <h3 id=grid-layering-of-elements><span class=secno>1.4. </span> Grid
630627
By leveraging grid layout, the author can instead limit script usage to
631628
handling mouse events on the thumb, which snaps to various positions along
632629
the track as the ‘<a href="#grid-definition-columns"><code
633-
class=property>grid-definition-columns</code></a>’ property of the <a
634-
href="#grid-container"><i>grid container</i></a> is updated.
630+
class=property>grid-definition-columns</code></a>’ property of the
631+
<i>grid container</i> is updated.
635632

636633
<pre class=example>
637634
&lt;style type="text/css">
@@ -679,78 +676,53 @@ <h3 id=grid-layering-of-elements><span class=secno>1.4. </span> Grid
679676
&lt;div id="thumb">Thumb&lt;/div>
680677
&lt;/div></pre>
681678

682-
<h2 id=grid-layout-box-model-and-terminology><span class=secno>2.
683-
</span>Grid Layout Box Model and Terminology</h2>
684-
685-
<p> A <dfn id=grid-container>grid container</dfn> is declared in markup by
686-
setting the display property of an element to ‘<a href="#grid"><code
687-
class=css>grid</code></a>’ or ‘<a href="#inline-grid"><code
688-
class=css>inline-grid</code></a>’. Children of a <a
689-
href="#grid-container"><i>grid container</i></a> are termed <a
690-
href="#grid-item"><i>grid items</i></a> and can be positioned and sized in
691-
the grid by leveraging the following logical concepts.
692-
693-
<ul>
694-
<li><a href="#grid-track"><i>grid tracks</i></a>
695-
696-
<li><a href="#grid-line"><i>grid lines</i></a>
697-
698-
<li><a href="#grid-area-concept"><i>grid areas</i></a>
699-
</ul>
700-
701-
<p> Figure 7 illustrates the relationship between these concepts and the
702-
markup in the subsections that follow produce the result shown in the
703-
figure.
704-
705-
<div class=figure> <img
706-
alt="Image: A diagram illustrating the relationship between the Grid Element and its Tracks, Lines, Areas and Items."
707-
class=figure src="images/grid-concepts.png">
708-
<p class=caption>A diagram illustrating the relationship between the <a
709-
href="#grid-container"><i>grid container</i></a> and its tracks, lines,
710-
areas and items.
711-
</div>
712-
713-
<h3 id=grid-rows-and-columns><span class=secno>2.1. </span> Grid Rows and
714-
Columns</h3>
679+
<h2 id=grid-concepts><span class=secno>2. </span> Core Concepts of the Grid</h2>
680+
681+
<p> <i>Grid containers</i> use <a href="#grid-line"><i>grid lines</i></a>
682+
to divide their space into <a href="#grid-track"><i>grid tracks</i></a>.
683+
There are two sets of <a href="#grid-line"><i>grid lines</i></a>: one set
684+
defining columns that run along the block axis, and an orthogonal set
685+
defining rows along the inline axis. The contents of a <i>grid
686+
container</i> are positioned, <i>item</i> by <i>item</i>, each into a <a
687+
href="#grid-area-concept"><i>grid area</i></a> bound by a set of four <a
688+
href="#grid-line"><i>grid lines</i></a>. They are sized and aligned to fit
689+
into the intersection of the corresponding <a href="#grid-track"><i>grid
690+
tracks</i></a>. <!--
691+
<div class="figure">
692+
<img class="figure" alt="Image: A diagram illustrating the relationship between the Grid Element and its Tracks, Lines, Areas and Items." src="images/grid-concepts.png" />
693+
<p class="caption">A diagram illustrating the relationship between the <i>grid container</i> and its tracks, lines, areas and items.
694+
</div>
695+
-->
715696

716-
<div class=sidefigure> <img alt="Image: Grid Lines." class=figure
697+
<div class=figure> <img alt="Image: Grid Lines." class=figure
717698
src="images/grid-lines.png">
718-
<p class=caption>Grid Lines.
699+
<p class=caption>Grid lines: 3 in the block axis and four in the inline
700+
axis.
719701
</div>
720702

721-
<p> <i>Grid elements</i> use <a href="#grid-line"><i>Grid lines</i></a> to
722-
divide their space. There are two sets of <a href="#grid-line"><i>Grid
723-
lines</i></a>: one set defined by the columns that run in the direction of
724-
block progression, and another orthogonal set defined by rows. Block
725-
progression is a writing-mode term that defines a logical direction. In
726-
English it means vertical.
727-
728-
<p> A <a href="#grid-track"><i>Grid track</i></a> is a generic term for a
729-
column or row which separates two <a href="#grid-line"><i>Grid
730-
lines</i></a>. Each <a href="#grid-track"><i>Grid track</i></a> is
731-
assigned a sizing function, which controls how wide or tall the column or
732-
row may grow, and thus how far apart two <a href="#grid-line"><i>Grid
733-
lines</i></a> are. The sizing function specified can be a length, a
734-
percentage of the <i>Grid element</i>’s size, derived from the contents
735-
occupying the column or row, or a proportion of the space which remains in
736-
the <i>Grid element</i>. In the last case, remaining space refers to the
737-
width or height of the <i>Grid element</i> after accounting for space
738-
already consumed by columns and rows sized with a length, percentage or
739-
content. The size can also be specified as a range using a minmax
740-
function, which can combine any of the previously mentioned mechanisms to
741-
define a min and max size for the column or row.
703+
<p> <a href="#grid-track"><i>Grid track</i></a> is a generic term for grid
704+
columns or rows, i.e. the space between two adjacent <a
705+
href="#grid-line"><i>grid lines</i></a>. Each <a
706+
href="#grid-track"><i>grid track</i></a> is assigned a sizing function,
707+
which controls how wide or tall the column or row may grow, and thus how
708+
far apart two <a href="#grid-line"><i>grid lines</i></a> are. The sizing
709+
function specified can be a length, a percentage of the <i>grid
710+
container</i>’s size, a measurement of the contents occupying the column
711+
or row, or a proportion of the unassigned space in the grid. The size can
712+
also be specified as a range using the ‘<code
713+
class=css>minmax()</code>’ notation, which can combine any of the
714+
previously mentioned mechanisms to define a min and max size for the
715+
column or row.
742716

743717
<div class=example>
744718
<p> In the following example there are two columns and three rows. The
745-
first column is 150px wide beginning from the starting edge of the
746-
<i>Grid element</i>’s content box. The second column uses fractional
747-
sizing, which is a function of the remaining space in the Grid. Its size
748-
will vary as the width of the <i>Grid element</i> changes. If the used
749-
width of the <i>Grid element</i> is 200px, then the second column 50px
750-
wide. If the used width of the <i>Grid element</i> is 100px, then the
751-
second column is 0px and any content positioned in the column will be
752-
overflowing the <i>Grid element</i>. Sizing occurs in a similar fashion
753-
for the rows.
719+
first column is fixed at 150px. The second column uses fractional sizing,
720+
which is a function of the unassigned space in the Grid, and thus will
721+
vary as the width of the <i>grid container</i> changes. If the used width
722+
of the <i>grid container</i> is 200px, then the second column 50px wide.
723+
If the used width of the <i>grid element</i> is 100px, then the second
724+
column is 0px and any content positioned in the column will overflow the
725+
<i>grid container</i>.
754726

755727
<pre>
756728
&lt;style type="text/css">
@@ -762,30 +734,25 @@ <h3 id=grid-rows-and-columns><span class=secno>2.1. </span> Grid Rows and
762734
&lt;/style></pre>
763735
</div>
764736

765-
<h3 id=grid-lines><span class=secno>2.2. </span>Grid Lines</h3>
737+
<h3 id=grid-lines><span class=secno>2.1. </span>Grid Lines</h3>
766738

767739
<p> <dfn id=grid-line title="grid line">Grid lines</dfn> are the horizontal
768-
or vertical dividing lines that exist on either side of a column or row.
769-
<a href="#grid-line"><i>Grid lines</i></a> may be referred to by their <a
770-
href="#grid-line"><i>grid line</i></a> number, or they may be named by the
771-
author. Authors use one or more quoted strings to assign names to a <a
772-
href="#grid-line"><i>Grid line</i></a> before or after a <a
773-
href="#grid-track"><i>Grid track</i></a> definition wherever the desired
774-
<a href="#grid-line"><i>Grid line</i></a> would logically exist. A <a
775-
href="#grid-item"><i>Grid item</i></a> then uses the <a
776-
href="#grid-line"><i>Grid lines</i></a> to determine its position within
777-
the Grid by referencing the <a href="#grid-line"><i>Grid lines</i></a>
778-
using the properties ‘<code class=property>grid-row-position</code>
779-
and ‘<code class=property>grid-column-position</code>’.
780-
781-
<p> The following two examples create three column <a
782-
href="#grid-line"><i>Grid lines</i></a> and four row <a
783-
href="#grid-line"><i>Grid lines</i></a>. The first example demonstrates
784-
how an author would position a <a href="#grid-item"><i>Grid item</i></a>
785-
using <a href="#grid-line"><i>Grid line</i></a> numbers. The second
786-
example uses explicitly named <a href="#grid-line"><i>Grid lines</i></a>.
740+
or vertical dividing lines of the grid. They may be referred to by their
741+
<a href="#grid-line"><i>grid line</i></a> number, or they may be named by
742+
the author. A <a href="#grid-item"><i>grid item</i></a> references these
743+
<a href="#grid-line"><i>grid lines</i></a> to determine its position
744+
within the grid using the <a href="#placement">grid-placement
745+
properties</a>.
787746

788-
<pre class=example>
747+
<div class=example>
748+
<p> The following two examples create three column <a
749+
href="#grid-line"><i>grid lines</i></a> and four row <a
750+
href="#grid-line"><i>grid lines</i></a>. The first example demonstrates
751+
how an author would position a <a href="#grid-item"><i>grid item</i></a>
752+
using <a href="#grid-line"><i>grid line</i></a> numbers. The second
753+
example uses explicitly named <a href="#grid-line"><i>grid lines</i></a>.
754+
755+
<pre>
789756
&lt;style type="text/css">
790757
#grid {
791758
display: grid;
@@ -796,7 +763,7 @@ <h3 id=grid-lines><span class=secno>2.2. </span>Grid Lines</h3>
796763
#item1 { grid-column-position: 2; grid-row-position: 1; grid-row-span: 3 }
797764
&lt;/style></pre>
798765

799-
<pre class=example>
766+
<pre>
800767
&lt;style type="text/css">
801768
/* equivalent layout to the prior example, but using named lines */
802769
#grid {
@@ -810,8 +777,9 @@ <h3 id=grid-lines><span class=secno>2.2. </span>Grid Lines</h3>
810777
grid-row: "item1-start" "item1-end"
811778
}
812779
&lt;/style></pre>
780+
</div>
813781

814-
<h3 id=grid-concepts-tracks><span class=secno>2.3. </span> Grid Tracks</h3>
782+
<h3 id=grid-concepts-tracks><span class=secno>2.2. </span> Grid Tracks</h3>
815783

816784
<p> <dfn id=grid-track>Grid Track</dfn>s are the columns and rows of the
817785
Grid defined with the ‘<a href="#grid-definition-rows"><code
@@ -831,7 +799,7 @@ <h3 id=grid-concepts-tracks><span class=secno>2.3. </span> Grid Tracks</h3>
831799
}
832800
&lt;/style></pre>
833801

834-
<h3 id=grid-areas><span class=secno>2.4. </span>Grid Areas</h3>
802+
<h3 id=grid-areas><span class=secno>2.3. </span>Grid Areas</h3>
835803

836804
<p> <dfn id=grid-area-concept>Grid Area</dfn>s are the logical space used
837805
to lay out one or more <a href="#grid-item"><i>Grid items</i></a>. <a
@@ -896,13 +864,13 @@ <h2 id=grid-containers><span class=secno>3. </span> Grid Containers: the
896864
<dl>
897865
<dt><dfn id=grid>grid</dfn>
898866

899-
<dd> This value causes an element to generate a block-level <a
900-
href="#grid-container"><i>grid container</i></a> box.
867+
<dd> This value causes an element to generate a block-level <i>grid
868+
container</i> box.
901869

902870
<dt><dfn id=inline-grid>inline-grid</dfn>
903871

904-
<dd> This value causes an element to generate an inline-level <a
905-
href="#grid-container"><i>grid container</i></a> box.
872+
<dd> This value causes an element to generate an inline-level <i>grid
873+
container</i> box.
906874
</dl>
907875

908876
<p> The baseline of an inline <i>Grid element</i> is the bottom edge of the
@@ -1123,7 +1091,7 @@ <h3 id=track-sizing><span class=secno>5.1. </span> Track Sizing: the ‘<a
11231091
<tr>
11241092
<td>Applies to:
11251093

1126-
<td><a href="#grid-container"><i>grid containers</i></a>
1094+
<td><i>grid containers</i>
11271095

11281096
<tr>
11291097
<td>Inherited:
@@ -1435,7 +1403,7 @@ <h3 id=grid-template-property><span class=secno>5.2. </span> Named Areas:
14351403
<tr>
14361404
<td>Applies to:
14371405

1438-
<td><a href="#grid-container"><i>grid containers</i></a>
1406+
<td><i>grid containers</i>
14391407

14401408
<tr>
14411409
<td>Inherited:
@@ -1545,7 +1513,7 @@ <h3 id=auto-tracks><span class=secno>5.3. </span> Auto-generated Rows and
15451513
<tr>
15461514
<td>Applies to:
15471515

1548-
<td><a href="#grid-container"><i>grid containers</i></a>
1516+
<td><i>grid containers</i>
15491517

15501518
<tr>
15511519
<td>Inherited:
@@ -1626,7 +1594,7 @@ <h3 id=auto-tracks><span class=secno>5.3. </span> Auto-generated Rows and
16261594
&lt;div id="C">C&lt;/div>
16271595
&lt;/div></pre>
16281596

1629-
<h2 id=placing-grid-items><span class=secno>6. </span>Placing Grid Items</h2>
1597+
<h2 id=placement><span class=secno>6. </span> Placing Grid Items</h2>
16301598

16311599
<p class=issue> Put in "common uses" section, like ‘<code
16321600
class=property>flex</code>’ has, to describe what you would use ‘<a
@@ -1710,8 +1678,7 @@ <h3 id=line-placement><span class=secno>6.1. </span> Line-based Placement:
17101678
<dt><dfn id=grid-placement-int title=""><var>&lt;integer></var></dfn>
17111679

17121680
<dd> Specifies the <var>N</var>th line from the corresponding edge of the
1713-
<a href="#grid-container"><i>grid container</i></a>. Negative integers or
1714-
zero are invalid.
1681+
<i>grid container</i>. Negative integers or zero are invalid.
17151682
<p class=issue> Should we let negative integers specify lines from the
17161683
opposite edge?
17171684

@@ -1729,10 +1696,9 @@ <h3 id=line-placement><span class=secno>6.1. </span> Line-based Placement:
17291696
<var>&lt;integer></var>?</dfn>
17301697

17311698
<dd> Specifies the <var>N</var>th line with the given name from the
1732-
corresponding edge of the <a href="#grid-container"><i>grid
1733-
container</i></a>. If the <var>&lt;integer></var> is omitted, it defaults
1734-
to ‘<code class=css>1</code>’. Negative integers or zero are invalid.
1735-
1699+
corresponding edge of the <i>grid container</i>. If the
1700+
<var>&lt;integer></var> is omitted, it defaults to ‘<code
1701+
class=css>1</code>’. Negative integers or zero are invalid.
17361702
<p class=issue> Should we let negative integers specify lines from the
17371703
opposite edge?
17381704

@@ -1989,7 +1955,7 @@ <h3 id=grid-auto-flow-property><span class=secno>6.3. </span> Automatic
19891955
<tr>
19901956
<td>Applies to:
19911957

1992-
<td><a href="#grid-container"><i>grid containers</i></a>
1958+
<td><i>grid containers</i>
19931959

19941960
<tr>
19951961
<td>Inherited:
@@ -3393,7 +3359,7 @@ <h2 class=no-num id=index> Index</h2>
33933359
title="section 6.1."><strong>6.1.</strong></a>
33943360

33953361
<li>Grid Area, <a href="#grid-area-concept"
3396-
title="section 2.4."><strong>2.4.</strong></a>
3362+
title="section 2.3."><strong>2.3.</strong></a>
33973363

33983364
<li>grid-area, <a href="#grid-area"
33993365
title="section 6.2."><strong>6.2.</strong></a>
@@ -3413,9 +3379,6 @@ <h2 class=no-num id=index> Index</h2>
34133379
<li>grid-column, <a href="#grid-column"
34143380
title="section 6.2."><strong>6.2.</strong></a>
34153381

3416-
<li>grid container, <a href="#grid-container"
3417-
title="section 2."><strong>2.</strong></a>
3418-
34193382
<li>grid-definition-columns, <a href="#grid-definition-columns"
34203383
title="section 5.1."><strong>5.1.</strong></a>
34213384

@@ -3432,7 +3395,7 @@ <h2 class=no-num id=index> Index</h2>
34323395
title="section 6.1."><strong>6.1.</strong></a>
34333396

34343397
<li>grid line, <a href="#grid-line"
3435-
title="section 2.2."><strong>2.2.</strong></a>
3398+
title="section 2.1."><strong>2.1.</strong></a>
34363399

34373400
<li>grid-row, <a href="#grid-row"
34383401
title="section 6.2."><strong>6.2.</strong></a>
@@ -3444,7 +3407,7 @@ <h2 class=no-num id=index> Index</h2>
34443407
title="section 5.2."><strong>5.2.</strong></a>
34453408

34463409
<li>Grid Track, <a href="#grid-track"
3447-
title="section 2.3."><strong>2.3.</strong></a>
3410+
title="section 2.2."><strong>2.2.</strong></a>
34483411

34493412
<li>inline-grid, <a href="#inline-grid"
34503413
title="section 3."><strong>3.</strong></a>

0 commit comments

Comments
 (0)