Skip to content

Commit f6eeab8

Browse files
committed
[css-align] Add a 'normal' value which acts like start/stretch depending on layout ode, to remove *-items' computed-value dependency on 'display'.
1 parent 1efac49 commit f6eeab8

1 file changed

Lines changed: 28 additions & 25 deletions

File tree

css-align/Overview.bs

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ Inline/Main-Axis Alignment: the 'justify-self' property</h3>
669669

670670
<pre class="propdef">
671671
Name: justify-self
672-
Value: auto | stretch | <<baseline-position>> | [ <<overflow-position>>? && <<self-position>> ]
672+
Value: auto | normal | stretch | <<baseline-position>> | [ <<overflow-position>>? && <<self-position>> ]
673673
Initial: auto
674674
Applies to: block-level boxes, absolutely-positioned boxes, and grid items
675675
Inherited: no
@@ -684,10 +684,12 @@ Inline/Main-Axis Alignment: the 'justify-self' property</h3>
684684
<a href="#alignment-values">as described by its alignment value</a>.
685685

686686
The <dfn value for="justify-self">auto</dfn> keyword computes to
687-
itself on absolutely-positioned elements,
688-
and to the computed value of 'justify-items' on the parent
689-
(minus any ''legacy'' keywords) on all other boxes,
687+
the computed value of 'justify-items' on the parent
688+
(minus any ''legacy'' keywords),
690689
or ''start'' if the box has no parent.
690+
691+
The <dfn value for="justify-self">normal</dfn> keyword
692+
represents the "default" alignment for the layout mode.
691693
Its behavior depends on the layout model, as described below.
692694

693695
When the box’s computed 'width'/'height' (as appropriate to the axis) is ''width/auto''
@@ -722,6 +724,8 @@ Inline/Main-Axis Alignment: the 'justify-self' property</h3>
722724

723725
This property does not apply to floats.
724726

727+
''justify-self/normal'' behaves as ''justify-self/start''.
728+
725729

726730
<dt>Absolutely-positioned Boxes:
727731
<dd>
@@ -732,7 +736,7 @@ Inline/Main-Axis Alignment: the 'justify-self' property</h3>
732736
'justify-self' has no effect.
733737
Otherwise, its effects are defined below.
734738

735-
The ''justify-self/auto'' keyword behaves as ''start'' on replaced absolutely-positioned boxes,
739+
The ''justify-self/normal'' keyword behaves as ''start'' on replaced absolutely-positioned boxes,
736740
and behaves as ''justify-self/stretch'' on all other absolutely-positioned boxes.
737741
(This is because CSS 2.1 does not stretch replaced elements to fit into fixed offsets.)
738742

@@ -768,6 +772,8 @@ Inline/Main-Axis Alignment: the 'justify-self' property</h3>
768772
The <a>alignment container</a> is the <a>grid area</a>.
769773
The <a>alignment subject</a> is the <a>grid item</a>’s margin box.
770774
The default <a>overflow alignment</a> is ''true''.
775+
776+
''justify-self/normal'' behaves as ''justify-self/stretch''.
771777
</dl>
772778

773779
<div class="example">
@@ -784,7 +790,7 @@ Block/Cross-Axis Alignment: the 'align-self' property</h3>
784790

785791
<pre class="propdef">
786792
Name: align-self
787-
Value: auto | stretch | <<baseline-position>> | [ <<overflow-position>>? && <<self-position>> ]
793+
Value: auto | normal | stretch | <<baseline-position>> | [ <<overflow-position>>? && <<self-position>> ]
788794
Initial: auto
789795
Applies to: flex items, grid items, and absolutely-positioned boxes
790796
Inherited: no
@@ -799,10 +805,11 @@ Block/Cross-Axis Alignment: the 'align-self' property</h3>
799805
<a href="#alignment-values">as described by its alignment value</a>.
800806

801807
The <dfn value for="align-self">auto</dfn> keyword computes to
802-
itself on absolutely-positioned elements,
803-
and to the computed value of 'align-items' on the parent
804-
on all other boxes,
805-
or ''align-self/start'' if the box has no parent.
808+
the computed value of 'align-items' on the parent
809+
or ''start'' if the box has no parent.
810+
811+
The <dfn value for="align-self">normal</dfn> keyword
812+
represents the "default" alignment for the layout mode.
806813
Its behavior depends on the layout model, as described for 'justify-self'.
807814

808815
The ''align-self/stretch'' keyword is as defined in [[#justify-self-property]].
@@ -818,6 +825,8 @@ Block/Cross-Axis Alignment: the 'align-self' property</h3>
818825
(including floats),
819826
because there is more than one item in the <a>block axis</a>.
820827

828+
''align-self/normal'' behaves as ''start''.
829+
821830
<dt>Absolutely-positioned Boxes:
822831
<dd>
823832
The 'align-self' property applies along its containing block's <a>block axis</a>.
@@ -844,7 +853,7 @@ Block/Cross-Axis Alignment: the 'align-self' property</h3>
844853
are ignored in favor of alignment as specified here
845854
and the used value of the offset properties are not adjusted to correct for the over-constraint.
846855

847-
The ''align-self/auto'' keyword behaves as ''start'' on replaced absolutely-positioned boxes,
856+
The ''align-self/normal'' keyword behaves as ''start'' on replaced absolutely-positioned boxes,
848857
and behaves as ''align-self/stretch'' on all other absolutely-positioned boxes.
849858
(This is because CSS 2.1 does not stretch replaced elements to fit into fixed offsets.)
850859

@@ -862,13 +871,17 @@ Block/Cross-Axis Alignment: the 'align-self' property</h3>
862871
The default <a>overflow alignment</a> is ''true''.
863872
See [[!CSS3-FLEXBOX]] for details.
864873

874+
''align-self/normal'' behaves as ''align-self/stretch''.
875+
865876
<dt>Grid Items:
866877
<dd>
867878
The 'align-self' property applies along the grid's <a>column axis</a>.
868879

869880
The <a>alignment container</a> is the <a>grid area</a>.
870881
The <a>alignment subject</a> is the <a>grid item</a>’s margin box.
871882
The default <a>overflow alignment</a> is ''true''.
883+
884+
''align-self/normal'' behaves as ''align-self/stretch''.
872885
</dl>
873886

874887
<h3 id="baseline-align-self">
@@ -933,7 +946,7 @@ Inline/Main-Axis Alignment: the 'justify-items' property</h3>
933946

934947
<pre class="propdef">
935948
Name: justify-items
936-
Value: auto | stretch | <<baseline-position>> | [ <<self-position>> && <<overflow-position>>? ] | [ legacy && [ ''<content-position>/left'' | ''<content-position>/right'' | ''<content-position>/center'' ] ]
949+
Value: auto | normal | stretch | <<baseline-position>> | [ <<self-position>> && <<overflow-position>>? ] | [ legacy && [ ''<content-position>/left'' | ''<content-position>/right'' | ''<content-position>/center'' ] ]
937950
Initial: auto
938951
Applies to: block containers and grid containers
939952
Inherited: no
@@ -954,12 +967,7 @@ Inline/Main-Axis Alignment: the 'justify-items' property</h3>
954967
If the <a>inherited value</a> of ''justify-items'' includes the ''legacy'' keyword,
955968
''justify-items/auto'' computes to the <a>inherited value</a>.
956969

957-
Otherwise, ''justify-items/auto'' computes to:
958-
959-
<ul>
960-
<li>''justify-self/stretch'' for flex containers and grid containers
961-
<li>''start'' for everything else
962-
</ul>
970+
Otherwise, ''justify-items/auto'' computes to ''justify-items/normal''.
963971

964972
<dt><dfn>legacy</dfn>
965973
<dd>
@@ -977,7 +985,7 @@ Block/Cross-Axis Alignment: the 'align-items' property</h3>
977985

978986
<pre class="propdef">
979987
Name: align-items
980-
Value: auto | stretch | <<baseline-position>> | [ <<self-position>> && <<overflow-position>>? ]
988+
Value: auto | normal | stretch | <<baseline-position>> | [ <<self-position>> && <<overflow-position>>? ]
981989
Initial: auto
982990
Applies to: block-level elements
983991
Inherited: no
@@ -995,12 +1003,7 @@ Block/Cross-Axis Alignment: the 'align-items' property</h3>
9951003
<dl dfn-type="value" dfn-for="align-items">
9961004
<dt><dfn>auto</dfn>
9971005
<dd>
998-
Computes to:
999-
1000-
<ul>
1001-
<li>''align-self/stretch'' for flex containers and grid containers
1002-
<li>''start'' for everything else
1003-
</ul>
1006+
Computes to ''align-items/normal''.
10041007
</dl>
10051008

10061009
Other values have no special handling and are merely passed to 'align-self'.

0 commit comments

Comments
 (0)