W3C home > Mailing lists > Public > public-css-archive@w3.org > November 2016

[csswg-drafts] [css-scroll-snap] Choosing a snap position when children have mixed scroll-snap-align values

From: Wenson Hsieh via GitHub <sysbot+gh@w3.org>
Date: Wed, 30 Nov 2016 21:42:56 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-192688148-1480542174-sysbot+gh@w3.org>
whsieh has just created a new issue for 

== [css-scroll-snap] Choosing a snap position when children have mixed
 scroll-snap-align values ==
(Concerning the Scroll Snap Module Level 1 spec here: 

Suppose we have a scroll snap container with 4 children arranged in a 
2 by 2 grid, and suppose the children have various mixed values for 
`scroll-snap-align`, such as `center none`, `none center`, and 
`center`. For simplicity, let's say that `scroll-snap-margin` and 
`scroll-padding` are all 0 on the children and container, 
respectively, and that the `scroll-snap-type` is `both mandatory`. 
Please see the attached diagram for an example.

Given an initial scroll position and a target scroll position where 
one would normally land in the absence of scroll snapping, what are 
some guidelines we should follow when selecting the best snap position
 to land on?

One naive approach is this: model the snap positions emitted by each 
snap area as line segments, with a start and end position (if neither 
block or inline axes are `none`, these positions are the same). For 
each snap area, compute the point on its line segment closest to the 
target scroll position. The snap position to choose is then the 
closest of these closest positions, provided this position is in the 
same direction as the scroll.

Does this seem reasonable?


Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/780 using your GitHub 
Received on Wednesday, 30 November 2016 21:43:03 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:05 UTC