Skip to content

Commit d82634f

Browse files
committed
[css-scroll-snap] Fix up computed value. Make it animate across percentages.
1 parent 932a1fc commit d82634f

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

css-scroll-snap/Overview.bs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,9 @@ Scroll Snapping Alignment: the 'scroll-snap-align' property {#scroll-snap-align}
443443
Applies to: all elements
444444
Inherited: no
445445
Percentages: refer to size of scroll container's <a>snap viewport</a> <em>minus</em> size of box's <a>snap area</a>
446-
Computed value: as specified
447-
Animatable: no
446+
Computed value: an optional ''point'' keyword, plus one or a pair of alignment values
447+
each consisting of either a ''none'' or ''edges'' keyword or a percentage
448+
Animatable: as percentage, if only the percentage differs
448449
Media: interactive
449450
</pre>
450451

@@ -482,18 +483,21 @@ Scroll Snapping Alignment: the 'scroll-snap-align' property {#scroll-snap-align}
482483
<pre>img { scroll-snap-align: center; }</pre>
483484
</div>
484485

485-
'scroll-snap-align' has four distinct families of values,
486-
depending on what <a>snap positions</a> you wish the element to declare:
486+
'scroll-snap-align' has four distinct syntaxes,
487+
depending on what <a>snap positions</a> you wish the element to specify:
487488

488489
<dl>
489490
<dt id=scroll-snap-align-none>none
490491
<dd>
491-
The element does not declare any <a>snap positions</a> at all.
492+
The element does not specify any <a>snap positions</a> at all,
493+
i.e. both axes compute to ''scroll-snap-align/none''.
492494

493495
<dt id=scroll-snap-align-single>[ block | inline ]? [ edges | <<snap-alignment>> ]
494496
<dd>
495497
The element declares a single <a>1D snap position</a>,
496-
in either the <a>block</a> or <a>inline</a> axis.
498+
in either the <a>block</a> or <a>inline</a> axis,
499+
as specified,
500+
and the other axis computes to ''scroll-snap-align/none''.
497501

498502
If neither <css>block</css> nor <css>inline</css> is specified,
499503
the axis is automatically chosen:
@@ -558,6 +562,7 @@ Scroll Snapping Alignment: the 'scroll-snap-align' property {#scroll-snap-align}
558562
where the percentage represents a position between
559563
''scroll-snap-align/start'' alignment and ''scroll-snap-align/end'' alignment.
560564
''0%'' matches the given alignment keyword (''scroll-snap-align/start'' or ''scroll-snap-align/end'').
565+
Percentages from the ''end'' compute to start-based percentages (as 100% &minus; <<percentage>>).
561566

562567
<dt><dfn>edges</dfn>
563568
<dd>

0 commit comments

Comments
 (0)