W3C home > Mailing lists > Public > www-style@w3.org > August 2013

Re: CSS properties for snapping during scrolling

From: Robert O'Callahan <robert@ocallahan.org>
Date: Fri, 16 Aug 2013 12:20:32 +1200
Message-ID: <CAOp6jLYRQ_aqjpDdtCierVJZZp3sbaN-atRYup_5Sk29h8soDw@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: www-style <www-style@w3.org>
On Fri, Aug 16, 2013 at 10:57 AM, Tab Atkins Jr. <jackalmage@gmail.com>wrote:

> Proposal's good, except for the tie to physical directions.
> scroll-snap-[vertical|horizontal] should be scroll-snap-[block|inline]

That's logical, but it sounds very confusing for authors :-(.

scroll-snap-edge should have values of: "none | [ margin-block-start
> || margin-inline-start || block-start || inline-start ]".  Maybe add
> just "margin-start || start" to it as well, which sets the edges in
> both axises.

Likewise. I think authors aren't going to understand what "block" and
"inline" mean in this context. "block-start" is much harder to understand
than "top".

Could we support both physical and logical properties and values here? I
think we could. So scroll-snap-edge values could be "none | [ left ||
margin-left || top || margin-top || inline-start || margin-inline-start ||
block-start || margin-block-start ]". (I've wondered whether
"end"/"right"/"bottom" values would be useful as well, but I haven't though
of a need yet.)

We could have four snapping-control properties:
scroll-snap-block-direction/inline-direction, and give the value of the
logical property priority of the physical property if it's not "none".

scroll-snap needs an additional value that abruptly jumps between the
> snap points, rather than allowing smooth scrolling and then adjusting
> to a snap point (this is used by things like spreadsheets).

Does this make sense for touch panning? I kinda doubt it does. Maybe
instead whether we abruptly jump between snap points should be up to the UA
and depend on the scroll mechanism?

I'd add an additional property for setting explicit snap points in
> addition to the implicit points coming from the children, probably
> with a repetition syntax so you can set up a snap point every 100px or
> whatever.

That makes sense.

Jtehsauts  tshaei dS,o n" Wohfy  Mdaon  yhoaus  eanuttehrotraiitny  eovni
le atrhtohu gthot sf oirng iyvoeu rs ihnesa.r"t sS?o  Whhei csha iids  teoa
stiheer :p atroa lsyazye,d  'mYaonu,r  "sGients  uapr,e  tfaokreg iyvoeunr,
'm aotr  atnod  sgaoy ,h o'mGee.t"  uTph eann dt hwea lmka'n?  gBoutt  uIp
waanndt  wyeonut  thoo mken.o w  *
Received on Friday, 16 August 2013 00:21:00 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:31 UTC