Skip to content

Commit e693915

Browse files
committed
[css-align] Rearrange the sections for better parallel structure. No normative changes.
1 parent 7a3b356 commit e693915

File tree

1 file changed

+60
-52
lines changed

1 file changed

+60
-52
lines changed

css-align/Overview.bs

Lines changed: 60 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ table.align-details { width: 100%; }
4848
<h2 id="intro">
4949
Introduction</h2>
5050

51+
<em>This section is not normative.</em>
52+
5153
CSS Levels 1 and 2 allowed for the alignment of text via 'text-align'
5254
and the alignment of blocks by balancing ''margin/auto'' margins.
5355
However, except in table cells,
@@ -64,8 +66,6 @@ Introduction</h2>
6466
If implementors or anyone else notices a discrepency,
6567
please report this to the CSSWG as an error.
6668

67-
<em>This section (above) is not normative.</em>
68-
6969
<h3 id="placement">
7070
Module interactions</h3>
7171

@@ -192,10 +192,9 @@ Overview of Alignment Properties</h2>
192192
<td><a>flex containers</a> and <a>grid containers</a>
193193
</table>
194194

195-
Note: The '*-items' properties don't actually <em>do</em> anything
196-
except through their effect on the initial value
197-
(''align-self/auto'') of the 'align-self' and 'justify-self' properties
198-
of the element’s children.
195+
Note: The '*-items' properties don't affect the element itself.
196+
When set on a container,
197+
they specify the interpretation of any ''*-self: auto'' used on children of the container element.
199198

200199
<h2 id='terms'>
201200
Alignment Terminology</h2>
@@ -219,7 +218,8 @@ Alignment Terminology</h2>
219218
<dd>
220219
The <a>alignment container</a> is the rectangle that the <a>alignment subject</a> is aligned within.
221220
This is defined by the layout mode,
222-
but is usually the <a>alignment subject</a>’s containing block.
221+
but is usually the <a>alignment subject</a>’s containing block,
222+
and assumes the writing mode of the box establishing the containing block.
223223

224224
<dt><dfn export>fallback alignment</dfn>
225225
<dd>
@@ -615,7 +615,10 @@ Overflow Alignment: the ''safe'' and ''unsafe'' keywords</h3>
615615
-->
616616

617617
<h2 id='content-distribution'>
618-
Content Distribution: the 'align-content' and 'justify-content' properties and 'place-content' shorthand</h2>
618+
Content Distribution: aligning a box's contents within itself</h2>
619+
620+
<h3 id='align-justify-content'>
621+
The 'justify-content' And 'align-content' Properties</h3>
619622

620623
The <dfn export>content distribution properties</dfn> 'align-content' and 'justify-content'
621624
(and their 'place-content' shorthand)
@@ -652,28 +655,6 @@ Content Distribution: the 'align-content' and 'justify-content' properties and '
652655
Aligns the contents of the box as a whole.
653656
Values other than <dfn value for="justify-content, align-content">normal</dfn> are defined in [[#alignment-values]], above.
654657

655-
<pre class="propdef">
656-
Name: place-content
657-
Value: <<'align-content'>> <<'justify-content'>>?
658-
Initial: normal
659-
Applies to: block containers, flex containers, and grid containers
660-
Inherited: no
661-
Percentages: n/a
662-
Media: visual
663-
Computed value: see individual properties
664-
Animatable: no
665-
</pre>
666-
667-
This <a>shorthand property</a> sets both the 'align-content' and 'justify-content' properties in one declaration.
668-
The first value is assigned to 'align-content'.
669-
The second value is assigned to 'justify-content';
670-
if omitted, it is copied from the first value,
671-
unless that value is a <<baseline-position>>
672-
in which case it is defaulted to ''start''.
673-
674-
Details per Layout Mode {#distribution-details}
675-
-----------------------------------------------
676-
677658
### Block Containers ### {#distribution-block}
678659

679660
<table class="data align-details">
@@ -811,6 +792,48 @@ Details per Layout Mode {#distribution-details}
811792

812793
See [[!CSS-GRID-1]] for details.
813794

795+
<h3 id='place-content'>
796+
Content Distribution Shorthand: the 'place-content' property</h3>
797+
798+
<pre class="propdef">
799+
Name: place-content
800+
Value: <<'align-content'>> <<'justify-content'>>?
801+
Initial: normal
802+
Applies to: block containers, flex containers, and grid containers
803+
Inherited: no
804+
Percentages: n/a
805+
Media: visual
806+
Computed value: see individual properties
807+
Animatable: no
808+
</pre>
809+
810+
This <a>shorthand property</a> sets both the 'align-content' and 'justify-content' properties in one declaration.
811+
The first value is assigned to 'align-content'.
812+
The second value is assigned to 'justify-content';
813+
if omitted, it is copied from the first value,
814+
unless that value is a <<baseline-position>>
815+
in which case it is defaulted to ''start''.
816+
817+
<h3 id="overflow-scroll-position">
818+
Overflow and Scroll Positions</h3>
819+
820+
The <a>content distribution properties</a> also affect the initial scroll position,
821+
setting it to display the appropriate portion of the scrollable area.
822+
In other words,
823+
the <a>scrollable overflow region</a> is aligned relative to the viewport
824+
as specified by the <a>content distribution properties</a>.
825+
Additionally, so that the content remains in the <a>scrollable overflow region</a> in order to be scrollable,
826+
the ''overflow/scroll'' and ''overflow/auto'' values of 'overflow'
827+
trigger ''safe'' content alignment always.
828+
829+
<div class='example'>
830+
For example,
831+
if a scrollable flex container is set to ''justify-content: flex-end''
832+
(or ''justify-content: flex-start'' with ''flex-flow: row-reverse''),
833+
it will be initially displayed scrolled all the way to the main-end edge of the scrollable area,
834+
and its content will appear to overflow its main-start edge.
835+
</div>
836+
814837
<h3 id="baseline-align-content">
815838
Baseline Content-Alignment</h3>
816839

@@ -865,26 +888,6 @@ Baseline Content-Alignment</h3>
865888
See [[#align-by-baseline]] for exact details.
866889
This can increase the intrinsic size of the box.
867890

868-
<h3 id="overflow-scroll-position">
869-
Overflow and Scroll Positions</h3>
870-
871-
Content that overflows a <a>scroll container</a>
872-
is aligned exactly like content in a non-scrollable container.
873-
However, to prevent content from being shifted into the unscrollable region,
874-
when the <a>content distribution properties</a> are set on a <a>scroll container</a>,
875-
the zero coordinate of its <a>scrollable overflow region</a>
876-
(that is, the point beyond which content is unreachable)
877-
is set to the top left corner of the <a>alignment subject</a>,
878-
effectively changing the <a>initial scroll position</a>.
879-
880-
<div class='example'>
881-
For example,
882-
if a scrollable flex container is set to ''justify-content: flex-end''
883-
(or ''justify-content: flex-start'' with ''flex-flow: row-reverse''),
884-
it will be initially displayed scrolled all the way to the main-end edge of the scrollable area,
885-
and its content will appear to overflow its main-start edge.
886-
</div>
887-
888891
<!--
889892
██████ ████████ ██ ████████
890893
██ ██ ██ ██ ██ ██ ██
@@ -1415,7 +1418,7 @@ Inline/Main-Axis Alignment: the 'justify-items' property</h3>
14151418
Inherited: no
14161419
Percentages: n/a
14171420
Media: visual
1418-
Computed value: specified value, except for ''justify-items/legacy'' (see prose)
1421+
Computed value: specified value, except for ''justify-items/auto'' (see prose)
14191422
Animatable: no
14201423
</pre>
14211424

@@ -1610,14 +1613,19 @@ Determining the Baselines of a Box</h2>
16101613
whichever is orthogonal to the box’s own 'writing-mode'.
16111614
<!-- This pairing is chosen because the most likely case for this situation is CJK. -->
16121615

1616+
Issue: Maybe these things are wrong?
1617+
CSS 2.1 is really weird about baseline alignment.
1618+
16131619
For the purposes of finding the baselines of a box,
16141620
it and all its in-flow descendants with a scrolling mechanism (see the 'overflow' property)
1615-
must be considered as if scrolled to their initial scroll position.
1621+
must be considered as if scrolled to their origin.
16161622
Furthermore, if, in the case of a box with non-''visible'' overflow,
16171623
the resulting position of a first (last) baseline
16181624
is past a box's end (start) border edge,
16191625
its position is clamped to that border edge.
16201626

1627+
ISSUE: This reflects the latest CSS2.1 errata, however see also discussion of an <a href="https://github.com/w3c/csswg-drafts/issues/766">alternate solution</a> that was previously drafted here.
1628+
16211629
<h3 id='baseline-terms'>
16221630
Baseline Alignment Grouping</h3>
16231631

0 commit comments

Comments
 (0)