Skip to content

Commit 162e106

Browse files
committed
[css-align] Re-add stretch as an <item-position>, since we removed it very badly and everything's confusing.
1 parent eeef379 commit 162e106

File tree

2 files changed

+64
-57
lines changed

2 files changed

+64
-57
lines changed

css-align/Overview.bs

+28-28
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Previous Version: http://www.w3.org/TR/2013/WD-css3-align-20130514/
1313
Previous Version: http://www.w3.org/TR/2012/WD-css3-align-20120612/
1414
Abstract: This module contains the features of <a href="http://www.w3.org/TR/CSS/">CSS</a> relating to the alignment of boxes within their containers in the various CSS box layout models: block layout, table layout, flex layout, and grid layout. (The alignment of text and inline-level content is defined in [[CSS3TEXT]] and [[CSS3LINE]].)
1515
!Issue Tracking: <a href="http://www.w3.org/Style/CSS/Tracker/products/39">http://www.w3.org/Style/CSS/Tracker/products/39</a>
16-
Link Defaults: selectors-3 (dfn) first formatted line, css-flexbox-1 (dfn) flex line, css-multicol-1 (dfn) multi-column element, css-fonts-3 (dfn) first available font, css21 (property) max-width/max-height
16+
Link Defaults: selectors-3 (dfn) first formatted line, css-flexbox-1 (dfn) flex line, css-multicol-1 (dfn) multi-column element, css-fonts-3 (dfn) first available font, css21 (property) max-width/max-height/min-width/min-height
1717
Ignored Terms: orthogonal, block container, table cell, main-axis
1818
At Risk: ''last-baseline''
1919
</pre>
@@ -184,7 +184,7 @@ Alignment Values</h2>
184184
</dl>
185185

186186
<h3 id='positional-values'>
187-
Positional Alignment: the ''center'', ''start'', ''end'', ''self-start'', ''self-end'', ''flex-start'', ''flex-end'', ''left'', and ''right'' keywords</h3>
187+
Positional Alignment: the ''center'', ''start'', ''end'', ''self-start'', ''self-end'', ''flex-start'', ''flex-end'', ''left'', ''right'', and ''<item-position>/stretch'' keywords</h3>
188188

189189
The positional alignment keywords specify a position for an <a>alignment subject</a>
190190
with respect to its <a>alignment container</a>.
@@ -198,7 +198,7 @@ Positional Alignment: the ''center'', ''start'', ''end'', ''self-start'', ''self
198198

199199
<pre class='prod'>
200200
<dfn>&lt;item-position></dfn> = center | start | end | self-start | self-end |
201-
flex-start | flex-end | left | right;
201+
flex-start | flex-end | left | right | stretch;
202202
<dfn>&lt;content-position></dfn> = center | start | end | flex-start | flex-end | left | right;
203203
</pre>
204204

@@ -208,14 +208,14 @@ Positional Alignment: the ''center'', ''start'', ''end'', ''self-start'', ''self
208208
<dl dfn-type="value">
209209
<dt><dfn for="<item-position>, <content-position>">center</dfn>
210210
<dd>Centers the <a>alignment subject</a> within its <a>alignment container</a>.
211-
<!--
212-
<dt><dfn>stretch</dfn>
213-
<dd>If the 'width' or 'height' (as appropriate) of the <a>alignment subject</a> is ''auto'',
211+
212+
<dt><dfn for="<item-position>">stretch</dfn>
213+
<dd>If the 'width' or 'height' (as appropriate) of the <a>alignment subject</a> is ''width/auto'',
214214
its used value is the length necessary to make the <a>alignment subject</a>’s outer size
215215
as close to the size of the <a>alignment container</a> as possible,
216-
while still respecting the constraints imposed by 'min/max-width/height'.
216+
while still respecting the constraints imposed by 'min-height'/'max-width'/etc.
217217
Otherwise, this is equivalent to ''start''.
218-
-->
218+
219219
<dt><dfn for="<item-position>, <content-position>">start</dfn>
220220
<dd>Aligns the <a>alignment subject</a> to be flush with the <a>alignment container</a>’s start edge.
221221

@@ -351,7 +351,7 @@ Baseline Alignment: the ''baseline'' and ''last-baseline'' keywords</h3>
351351

352352

353353
<h3 id='distribution-values'>
354-
Distributed Alignment: the ''stretch'', ''space-between'', ''space-around'', and ''space-evenly'' keywords</h3>
354+
Distributed Alignment: the ''<content-distribution>/stretch'', ''space-between'', ''space-around'', and ''space-evenly'' keywords</h3>
355355

356356
The distribution values are used by 'justify-content' and 'align-content'
357357
to distribute the items in the <a>alignment subject</a>
@@ -506,21 +506,21 @@ Content Distribution: the 'justify-content' and 'align-content' properties</h2>
506506

507507
<dt>Flex Containers:
508508
<dd>
509-
''justify-content/auto'' computes to ''stretch''.
509+
''justify-content/auto'' computes to ''<content-distribution>/stretch''.
510510

511511
The <a>alignment container</a> is the <a>flex container</a>’s content box.
512512
For 'justify-content', the <a>alignment subject</a> is the <a>flex items</a> in each <a>flex line</a>;
513513
for 'align-content', the <a>alignment subject</a> is the <a>flex lines</a>.
514514

515515
The 'align-content' property applies along the <a>cross axis</a>.
516516
The 'justify-content' property applies along the <a>main axis</a>,
517-
but ''stretch'' behaves as ''flex-start''.
517+
but ''<content-distribution>/stretch'' behaves as ''flex-start''.
518518

519519
See [[!CSS3-FLEXBOX]] for details.
520520

521521
<dt>Grid Containers:
522522
<dd>
523-
''justify-content/auto'' computes to ''start'', and ''stretch'' behaves like ''start''.
523+
''justify-content/auto'' computes to ''start'', and ''<content-distribution>/stretch'' behaves like ''start''.
524524

525525
The <a>alignment container</a> is the <a>grid container</a>’s content box.
526526
The <a>alignment subject</a> is the bounds of the <a>grid</a>.
@@ -556,14 +556,14 @@ Baseline Content-Alignment</h3>
556556
A <a>flex item</a> participates in first (last) <a>baseline content-alignment</a>
557557
in its flex line if
558558
its computed 'align-content' is ''baseline'' (''last-baseline'')
559-
and its computed 'align-self' is ''stretch'' or ''start'' (''end'').
559+
and its computed 'align-self' is ''<item-position>/stretch'' or ''start'' (''end'').
560560

561561
<dt>Grid Items:
562562
<dd>
563563
A <a>grid item</a> participates in first (last) <a>baseline content-alignment</a>
564564
in either its row or column (whichever matches its <a>inline axis</a>)
565565
if its computed 'align-content' is ''baseline'' (''last-baseline''),
566-
and its computed 'align-self' or 'justify-self' (whichever affects its <a>block axis</a>) is ''stretch'' or ''start'' (''end'').
566+
and its computed 'align-self' or 'justify-self' (whichever affects its <a>block axis</a>) is ''<item-position>/stretch'' or ''start'' (''end'').
567567
</dl>
568568

569569
If a box spans multiple <a>shared alignment contexts</a>,
@@ -613,7 +613,7 @@ Inline/Main-Axis Alignment: the 'justify-self' property</h3>
613613

614614
<pre class="propdef">
615615
Name: justify-self
616-
Value: auto | ''stretch'' | <<baseline-position>> | [ <<item-position>> && <<overflow-position>>? ]
616+
Value: auto | <<baseline-position>> | [ <<item-position>> && <<overflow-position>>? ]
617617
Initial: auto
618618
Applies to: block-level boxes, absolutely-positioned boxes, and grid items
619619
Inherited: no
@@ -628,7 +628,7 @@ Inline/Main-Axis Alignment: the 'justify-self' property</h3>
628628
<a href="#alignment-values">as described by its alignment value</a>.
629629

630630
The <dfn value for="justify-self">auto</dfn> keyword computes to
631-
''stretch'' on absolutely-positioned elements,
631+
''<item-position>/stretch'' on absolutely-positioned elements,
632632
and to the computed value of 'justify-items' on the parent
633633
(minus any ''legacy'' keywords) on all other boxes.
634634

@@ -652,7 +652,7 @@ Inline/Main-Axis Alignment: the 'justify-self' property</h3>
652652
are ignored in favor of alignment as specified here
653653
and the used value of the offset properties are not adjusted to correct for the over-constraint.
654654

655-
The ''stretch'' value is equivalent to ''start'' on block-level boxes.
655+
The ''<item-position>/stretch'' value is equivalent to ''start'' on block-level boxes.
656656

657657
This property does not apply to floats.
658658

@@ -663,7 +663,7 @@ Inline/Main-Axis Alignment: the 'justify-self' property</h3>
663663

664664
When neither margin in this dimension is ''margin/auto''
665665
and neither offset property in this dimension is ''top/auto'',
666-
values other than ''stretch'' cause <a href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width">non-replaced absolutely-positioned boxes</a>
666+
values other than ''<item-position>/stretch'' cause <a href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width">non-replaced absolutely-positioned boxes</a>
667667
to use shrink-to-fit sizing for calculating ''width/auto'' measures,
668668
and 'justify-self' dictates alignment as follows:
669669

@@ -677,7 +677,7 @@ Inline/Main-Axis Alignment: the 'justify-self' property</h3>
677677
are ignored in favor of alignment as specified here
678678
and the used value of the offset properties are not adjusted to correct for the over-constraint.
679679

680-
The ''stretch'' keyword is equivalent to ''start'' on replaced absolutely-positioned boxes.
680+
The ''<item-position>/stretch'' keyword is equivalent to ''start'' on replaced absolutely-positioned boxes.
681681
(This is because CSS 2.1 does not stretch replaced elements to fit into fixed offsets.)
682682

683683
<dt>Table Cells:
@@ -701,7 +701,7 @@ Inline/Main-Axis Alignment: the 'justify-self' property</h3>
701701
</dl>
702702

703703
<p class='issue'>
704-
Should we make ''stretch'' actually work on block-level/abspos replaced boxes?
704+
Should we make ''<item-position>/stretch'' actually work on block-level/abspos replaced boxes?
705705
To maintain legacy compat, this requires adding a new value (named ''normal''?)
706706
which has the current behavior of stretching non-replaced boxes and start-aligning replaced ones.
707707

@@ -719,7 +719,7 @@ Block/Cross-Axis Alignment: the 'align-self' property</h3>
719719

720720
<pre class="propdef">
721721
Name: align-self
722-
Value: auto | ''stretch'' | <<baseline-position>> | [ <<item-position>> && <<overflow-position>>? ]
722+
Value: auto | <<baseline-position>> | [ <<item-position>> && <<overflow-position>>? ]
723723
Initial: auto
724724
Applies to: block-level boxes
725725
Inherited: no
@@ -734,7 +734,7 @@ Block/Cross-Axis Alignment: the 'align-self' property</h3>
734734
<a href="#alignment-values">as described by its alignment value</a>.
735735

736736
The <dfn value for="align-self">auto</dfn> keyword computes to
737-
''stretch'' on absolutely-positioned elements,
737+
''<item-position>/stretch'' on absolutely-positioned elements,
738738
and to the computed value of 'align-items' on the parent
739739
(minus any ''legacy'' keywords) on all other boxes.
740740

@@ -753,7 +753,7 @@ Block/Cross-Axis Alignment: the 'align-self' property</h3>
753753

754754
When neither margin in this dimension is ''margin/auto''
755755
and neither offset property in this dimension is ''top/auto'',
756-
values other than ''stretch'' cause <a href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height">non-replaced absolutely-positioned boxes</a>
756+
values other than ''<item-position>/stretch'' cause <a href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height">non-replaced absolutely-positioned boxes</a>
757757
to use shrink-to-fit sizing for calculating ''width/auto'' measures,
758758
and 'align-self' dictates alignment as follows:
759759

@@ -767,7 +767,7 @@ Block/Cross-Axis Alignment: the 'align-self' property</h3>
767767
are ignored in favor of alignment as specified here
768768
and the used value of the offset properties are not adjusted to correct for the over-constraint.
769769

770-
The ''stretch'' keyword is equivalent to ''start'' on replaced absolutely-positioned boxes.
770+
The ''<item-position>/stretch'' keyword is equivalent to ''start'' on replaced absolutely-positioned boxes.
771771
(This is because CSS 2.1 does not stretch replaced elements to fit into fixed offsets.)
772772

773773
<dt>Table Cells:
@@ -844,7 +844,7 @@ Inline/Main-Axis Alignment: the 'justify-items' property</h3>
844844

845845
<pre class="propdef">
846846
Name: justify-items
847-
Value: auto | ''stretch'' | <<baseline-position>> | [ <<item-position>> && <<overflow-position>>? ] | [ legacy && [ ''left'' | ''right'' | ''center'' ] ]
847+
Value: auto | <<baseline-position>> | [ <<item-position>> && <<overflow-position>>? ] | [ legacy && [ ''left'' | ''right'' | ''center'' ] ]
848848
Initial: auto
849849
Applies to: block containers, flex containers, and grid containers
850850
Inherited: no
@@ -868,7 +868,7 @@ Inline/Main-Axis Alignment: the 'justify-items' property</h3>
868868
Otherwise, ''justify-items/auto'' computes to:
869869

870870
<ul>
871-
<li>''stretch'' for flex containers and grid containers
871+
<li>''<item-position>/stretch'' for flex containers and grid containers
872872
<li>''start'' for everything else
873873
</ul>
874874

@@ -887,7 +887,7 @@ Block/Cross-Axis Alignment: the 'align-items' property</h3>
887887

888888
<pre class="propdef">
889889
Name: align-items
890-
Value: auto | ''stretch'' | <<baseline-position>> | [ <<item-position>> && <<overflow-position>>? ]
890+
Value: auto | <<baseline-position>> | [ <<item-position>> && <<overflow-position>>? ]
891891
Initial: auto
892892
Applies to: block-level elements
893893
Inherited: no
@@ -908,7 +908,7 @@ Block/Cross-Axis Alignment: the 'align-items' property</h3>
908908
Computes to:
909909

910910
<ul>
911-
<li>''stretch'' for flex containers and grid containers
911+
<li>''<item-position>/stretch'' for flex containers and grid containers
912912
<li>''start'' for everything else
913913
</ul>
914914
</dl>

0 commit comments

Comments
 (0)