Re: [css-scroll-snap] Add property to define 'proximity'

On Sun, Dec 13, 2015 at 2:10 PM, Sebastian Zartner
<sebastianzartner@gmail.com> wrote:
> Currently the description for the value 'proximity' lets it up to the
> UA to determine when snapping should happen.
>
> Though there may be some situations in which an author wants to
> specify the distance at which the element is snapped by himself.
>
> E.g. taking the example of cities in a map, it should be possible to
> define how far away from a city the viewport should be snapped to it.
>
> This property could be called 'scroll-snap-distance' and may have the
> following syntax:
>
> scroll-snap-distance: auto | <length>{1,2}
>
> Where <length> defines the absolute block and inline distances. If
> only one value is given, it refers to both axises.
> A third possible value may be <percentage>, which would define the
> distance(s) relative to the block or inline size of the viewport or
> scroll container. Though I'm not sure whether that is needed.

We're not sure this functionality is needed at all, which is why we
haven't included it yet. ^_^  You already have three choices for snap
distance: 0 (no snapping), "a small distance" (proximity), and
infinity (mandatory).  So far our thinking is that it's more important
to (a) let UAs experiment with optimal distances, possibly varying
based on device, and (b) ensure users have a consistent "feel" to
snapping, so we intentionally give very little explicit control to the
snapping mechanics.

If it turns out that this sort of control would be useful, we can add
it in the future.

~TJ

Received on Monday, 14 December 2015 23:24:25 UTC