Skip to content

Commit a23a846

Browse files
committed
[css-align] Define how justify/align-content affect initial scroll position.
1 parent 23b323e commit a23a846

2 files changed

Lines changed: 63 additions & 27 deletions

File tree

css-align/Overview.bs

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -466,11 +466,6 @@ Content Distribution: the 'justify-content' and 'align-content' properties</h2>
466466
Animatable: no
467467
</pre>
468468

469-
Issue: This should also affect the initial scroll position.
470-
If you align "end", you want to be able to see the "end" stuff when the element first loads,
471-
which means the scrollbar has to be scrolled all the way to the end
472-
(or equivalent, for scrollable overflows that don't generate scrollbars).
473-
474469
Aligns the contents of the box as a whole along the box's inline/row/main axis.
475470
Values other than <dfn value for="justify-content, align-content">auto</dfn> are <a href="#alignment-values">defined above</a>.
476471
If both a <<content-distribution>> and <<content-position>> are given,
@@ -581,6 +576,29 @@ Baseline Content-Alignment</h3>
581576
to match its <a>alignment baseline</a> in that axis up to that of its <a>baseline-sharing group</a>.
582577
This increases the intrinsic size of the box.
583578

579+
<h3 id="overflow-alignment">
580+
Overflow and Alignment: scroll positions</h3>
581+
582+
The <a>content distribution properties</a> also affect the initial scroll position,
583+
setting it to display the appropriate portion of the scrollable area.
584+
In other words,
585+
the scrollable area is aligned relative to the viewport
586+
as specified by the <a>content distribution property</a>.
587+
588+
<div class='example'>
589+
For example,
590+
if a scrollable flex container is set to ''justify-content: flex-end;''
591+
or ''justify-content: flex-start;'' with a 'flex-direction' of ''row-reverse'',
592+
it will be initially displayed scrolled all the way to the main-end edge of the scrollable area,
593+
and its content will overflow its main-start edge.
594+
</div>
595+
596+
Issue: This section is under discussion in the WG.
597+
598+
Issue: This needs to be integrated with overflow-anchor, when the property exists,
599+
so that you get the same behavior whether an elements *starts out* overflowing,
600+
or is filled element-by-element.
601+
584602
<h2 id='self-alignment'>
585603
Self-Alignment: Aligning the Box within its Parent</h2>
586604

0 commit comments

Comments
 (0)