Skip to content

Commit b965bec

Browse files
committed
Editorial rewrite of flex-line-pack to match flex-pack's wording.
1 parent 9818d61 commit b965bec

2 files changed

Lines changed: 71 additions & 39 deletions

File tree

css3-flexbox/Overview.html

Lines changed: 60 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616

1717
<h1 id=head-box-flexible>CSS Flexible Box Layout Module</h1>
1818

19-
<h2 class="no-num no-toc" id=w3c-working>Editor's Draft, 27 August 2011</h2>
19+
<h2 class="no-num no-toc" id=w3c-working>Editor's Draft, 31 August 2011</h2>
2020

2121
<dl>
2222
<dt>This version:
2323

24-
<dd><!-- <a href="http://www.w3.org/TR/2011/WD-css3-flexbox-20110827/">http://www.w3.org/TR/2011/WD-css3-flexbox-20110827/</a></dd> -->
24+
<dd><!-- <a href="http://www.w3.org/TR/2011/WD-css3-flexbox-20110831/">http://www.w3.org/TR/2011/WD-css3-flexbox-20110831/</a></dd> -->
2525
<a
2626
href="http://dev.w3.org/csswg/css3-flexbox/">http://dev.w3.org/csswg/css3-flexbox/</a>
2727

@@ -1324,9 +1324,19 @@ <h2 id=multiline><span class=secno>6. </span> Multi-line flexbox</h2>
13241324
class=property>flex-pack</code></a>&rsquo; and &lsquo;<a
13251325
href="#flex-align0"><code class=property>flex-align</code></a>&rsquo;
13261326
properties only pay attention to the items on a single line at a time. The
1327-
size of a line depends on the contents of the lines and the value of the
1328-
&lsquo;<a href="#flex-align0"><code
1329-
class=property>flex-align</code></a>&rsquo; property. The lines are
1327+
<a href="#main-size"><i>main size</i></a> of a line is the same as the <a
1328+
href="#main-size"><i>main size</i></a> of the flexbox's content box. The
1329+
<a href="#cross-size"><i>cross size</i></a> of a line depends on whether
1330+
the flexbox is <a href="#single-line"><i>single-line</i></a> or <a
1331+
href="#multi-line"><i>multi-line</i></a>: the <a
1332+
href="#cross-size"><i>cross size</i></a> of the sole line in a <a
1333+
href="#single-line"><i>single-line</i></a> flexbox is the same as the <a
1334+
href="#cross-size"><i>cross size</i></a> of the flexbox's content box,
1335+
while the <a href="#cross-size"><i>cross size</i></a> of a line in a <a
1336+
href="#multi-line"><i>multi-line</i></a> flexbox is the minimum size
1337+
necessary to contain the <a href="#flexbox-item"><i>flexbox items</i></a>
1338+
on the line, after aligning them with &lsquo;<a href="#flex-align0"><code
1339+
class=property>flex-align</code></a>&rsquo;. The lines themselves are then
13301340
aligned within a flexbox with the &lsquo;<a href="#flex-line-pack0"><code
13311341
class=property>flex-line-pack</code></a>&rsquo; property.
13321342

@@ -1440,7 +1450,7 @@ <h3 id=flex-line-pack><span class=secno>6.1. </span> &lsquo;<a
14401450
<tr>
14411451
<th>Applies to:
14421452

1443-
<td>flexboxes
1453+
<td><a href="#multi-line"><i>multi-line</i></a> flexboxes
14441454

14451455
<tr>
14461456
<th>Inherited:
@@ -1458,44 +1468,64 @@ <h3 id=flex-line-pack><span class=secno>6.1. </span> &lsquo;<a
14581468
<td>visual
14591469
</table>
14601470

1461-
<p>The flex-line-pack property may be used to control the alignment of
1462-
lines in multi-line flexboxes. The values of this property have the
1463-
following meanings:
1471+
<p>The &lsquo;<a href="#flex-line-pack0"><code
1472+
class=property>flex-line-pack</code></a>&rsquo; property aligns a
1473+
flexbox's lines within the flexbox when there is extra space in the <a
1474+
href="#cross-axis"><i>cross axis</i></a>, similar to how &lsquo;<a
1475+
href="#flex-pack0"><code class=property>flex-pack</code></a>&rsquo; aligns
1476+
individual items within the <a href="#main-axis"><i>main axis</i></a>:
14641477

14651478
<dl>
14661479
<dt><dfn id=flex-line-pack-start>start</dfn>
14671480

1468-
<dd>The first line of child boxes is placed along the &lsquo;<a
1469-
href="#flex-align-before"><code class=property>before</code></a>&rsquo;
1470-
edge of the content box (as determined by direction of <a
1471-
href="#cross-axis"><i>cross axis</i></a>), and additional lines are
1472-
placed afterward with no extra spacing between them.
1481+
<dd>Lines are packed toward the start of the flexbox. The <a
1482+
href="#cross-start"><i>cross-start</i></a> edge of the first line in the
1483+
flexbox is placed flush with the <a
1484+
href="#cross-start"><i>cross-start</i></a> edge of the flexbox, and each
1485+
subsequent line is placed flush with the preceding line.
14731486

14741487
<dt><dfn id=flex-line-pack-end>end</dfn>
14751488

1476-
<dd>Lines of child boxes are placed with no extra spacing between and
1477-
&lsquo;<a href="#flex-align-after"><code
1478-
class=property>after</code></a>&rsquo; edge of the last line is aligned
1479-
with &lsquo;<a href="#flex-align-after"><code
1480-
class=property>after</code></a>&rsquo; edge of the content box.
1489+
<dd>Lines are packed toward the end of the flexbox. The <a
1490+
href="#cross-end"><i>cross-end</i></a> edge of the last line is placed
1491+
flush with the <a href="#cross-end"><i>cross-end</i></a> edge of the
1492+
flexbox, and each preceding line is placed flush with the subsequent
1493+
line.
14811494

14821495
<dt><dfn id=flex-line-pack-center>center</dfn>
14831496

1484-
<dd>Lines of child boxes are placed with no space between them and equal
1485-
amount of extra space left before first line and after last line.
1497+
<dd>Lines are packed toward the center of the flexbox. If the leftover
1498+
free-space is negative, this value is identical to &lsquo;<a
1499+
href="#flex-line-pack-start"><code class=css>start</code></a>&rsquo;.
1500+
Otherwise, the lines in the flexbox are placed flush with each other and
1501+
aligned in the center of the flexbox, with equal amounts of empty space
1502+
between the <a href="#cross-start"><i>cross-start</i></a> content edge of
1503+
the flexbox and the first line in the flexbox and between the <a
1504+
href="#cross-end"><i>cross-end</i></a> content edge of the flexbox and
1505+
the last line in the flexbox.
14861506

14871507
<dt><dfn id=flex-line-pack-distribute>distribute</dfn>
14881508

1489-
<dd>The first line of child boxes is aligned with &lsquo;<a
1490-
href="#flex-align-before"><code class=property>before</code></a>&rsquo;
1491-
edge of containing box. Lines of child boxes are spread with equal amout
1492-
of empty spaces between each two lines, and so that &lsquo;<a
1493-
href="#flex-align-after"><code class=property>after</code></a>&rsquo;
1494-
edge of last line of child boxes is aligned with &lsquo;<a
1495-
href="#flex-align-after"><code class=property>after</code></a>&rsquo;
1496-
edge of conaining box.
1509+
<dd>Lines are evenly distributed in the flexbox. If the leftover
1510+
free-space is negative or there is only a single line in the flexbox,
1511+
this value is identical to &lsquo;<a href="#flex-line-pack-start"><code
1512+
class=css>start</code></a>&rsquo;. Otherwise, the <a
1513+
href="#cross-start"><i>cross-start</i></a> edge of the first line in the
1514+
flexbox is placed flush with the <a
1515+
href="#cross-start"><i>cross-start</i></a> content edge of the flexbox,
1516+
the <a href="#cross-end"><i>cross-end</i></a> edge of the last line in
1517+
the flexbox is placed flush with the <a
1518+
href="#cross-end"><i>cross-end</i></a> content edge of the flexbox, and
1519+
the remaining lines in the flexbox are distributed so that the empty
1520+
space between any two adjacent lines is the same.
14971521
</dl>
14981522

1523+
<p class=note>Note: Only <a href="#multi-line"><i>multi-line</i></a>
1524+
flexboxes ever have free space in the <a href="#cross-axis"><i>cross
1525+
axis</i></a> for lines to be aligned in, because in a <a
1526+
href="#single-line"><i>single-line</i></a> flexbox the sole line
1527+
automatically stretches to fill the space.
1528+
14991529
<p class=issue>TODO: examples
15001530

15011531
<h2 id=layout-algorithm><span class=secno>7. </span> Flexbox Layout
@@ -1822,7 +1852,7 @@ <h2 class=no-num id=property>Property index</h2>
18221852

18231853
<td>before
18241854

1825-
<td>flexboxes
1855+
<td>multi-line flexboxes
18261856

18271857
<td>no
18281858

css3-flexbox/Overview.src.html

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ <h2 id='multiline'>
606606

607607
<p>A flexbox can be either single-line or multi-line, depending on the 'flex-flow' property. A <dfn>single-line</dfn> flexbox lays out all of its children in a single line, even if that would cause the flexbox to overflow its bounds. A <dfn>multi-line</dfn> flexbox breaks its <i>flexbox items</i> across multiple lines to avoid overflowing, similar to how text is broken onto a new line when it gets too wide to fit on the existing line. Every line contains at least one <i>flexbox item</i>, unless the flexbox itself is completely empty.</p>
608608

609-
<p>When additional lines are created, they are stacked in the flexbox in the <i>cross axis</i>. Each line is completely independent; flexible lengths and the 'flex-pack' and 'flex-align' properties only pay attention to the items on a single line at a time. The size of a line depends on the contents of the lines and the value of the 'flex-align' property. The lines are aligned within a flexbox with the 'flex-line-pack' property.</p>
609+
<p>When additional lines are created, they are stacked in the flexbox in the <i>cross axis</i>. Each line is completely independent; flexible lengths and the 'flex-pack' and 'flex-align' properties only pay attention to the items on a single line at a time. The <i>main size</i> of a line is the same as the <i>main size</i> of the flexbox's content box. The <i>cross size</i> of a line depends on whether the flexbox is <i>single-line</i> or <i>multi-line</i>: the <i>cross size</i> of the sole line in a <i>single-line</i> flexbox is the same as the <i>cross size</i> of the flexbox's content box, while the <i>cross size</i> of a line in a <i>multi-line</i> flexbox is the minimum size necessary to contain the <i>flexbox items</i> on the line, after aligning them with 'flex-align'. The lines themselves are then aligned within a flexbox with the 'flex-line-pack' property.</p>
610610

611611
<div class=example>
612612
<p>This example shows four buttons that do not fit horizontally.</p>
@@ -682,7 +682,7 @@ <h3 id='flex-line-pack'>
682682
<td>before
683683
<tr>
684684
<th>Applies to:
685-
<td>flexboxes
685+
<td><i>multi-line</i> flexboxes
686686
<tr>
687687
<th>Inherited:
688688
<td>no
@@ -694,22 +694,24 @@ <h3 id='flex-line-pack'>
694694
<td>visual
695695
</table>
696696

697-
<p>The flex-line-pack property may be used to control the alignment of lines in multi-line flexboxes. The values of this property have the following meanings:</p>
697+
<p>The 'flex-line-pack' property aligns a flexbox's lines within the flexbox when there is extra space in the <i>cross axis</i>, similar to how 'flex-pack' aligns individual items within the <i>main axis</i>:</p>
698698

699699
<dl>
700700
<dt><dfn id='flex-line-pack-start'>start</dfn></dt>
701-
<dd>The first line of child boxes is placed along the 'before' edge of the content box (as determined by direction of <i>cross axis</i>), and additional lines are placed afterward with no extra spacing between them.</dd>
701+
<dd>Lines are packed toward the start of the flexbox. The <i>cross-start</i> edge of the first line in the flexbox is placed flush with the <i>cross-start</i> edge of the flexbox, and each subsequent line is placed flush with the preceding line.</dd>
702702

703703
<dt><dfn id='flex-line-pack-end'>end</dfn></dt>
704-
<dd>Lines of child boxes are placed with no extra spacing between and 'after' edge of the last line is aligned with 'after' edge of the content box.</dd>
704+
<dd>Lines are packed toward the end of the flexbox. The <i>cross-end</i> edge of the last line is placed flush with the <i>cross-end</i> edge of the flexbox, and each preceding line is placed flush with the subsequent line.</dd>
705705

706706
<dt><dfn id='flex-line-pack-center'>center</dfn></dt>
707-
<dd>Lines of child boxes are placed with no space between them and equal amount of extra space left before first line and after last line.</dd>
708-
707+
<dd>Lines are packed toward the center of the flexbox. If the leftover free-space is negative, this value is identical to ''start''. Otherwise, the lines in the flexbox are placed flush with each other and aligned in the center of the flexbox, with equal amounts of empty space between the <i>cross-start</i> content edge of the flexbox and the first line in the flexbox and between the <i>cross-end</i> content edge of the flexbox and the last line in the flexbox.</dd>
708+
709709
<dt><dfn id='flex-line-pack-distribute'>distribute</dfn></dt>
710-
<dd>The first line of child boxes is aligned with 'before' edge of containing box. Lines of child boxes are spread with equal amout of empty spaces between each two lines, and so that 'after' edge of last line of child boxes is aligned with 'after' edge of conaining box.</dd>
710+
<dd>Lines are evenly distributed in the flexbox. If the leftover free-space is negative or there is only a single line in the flexbox, this value is identical to ''start''. Otherwise, the <i>cross-start</i> edge of the first line in the flexbox is placed flush with the <i>cross-start</i> content edge of the flexbox, the <i>cross-end</i> edge of the last line in the flexbox is placed flush with the <i>cross-end</i> content edge of the flexbox, and the remaining lines in the flexbox are distributed so that the empty space between any two adjacent lines is the same.</dd>
711711
</dl>
712-
712+
713+
<p class='note'>Note: Only <i>multi-line</i> flexboxes ever have free space in the <i>cross axis</i> for lines to be aligned in, because in a <i>single-line</i> flexbox the sole line automatically stretches to fill the space.</p>
714+
713715
<p class="issue">TODO: examples</p>
714716

715717

0 commit comments

Comments
 (0)