W3C home > Mailing lists > Public > www-style@w3.org > January 2016

[css-snappoints][css-scroll-snap] scroll-snap-point-type and scroll-snap-align on the same element

From: Florian Rivoal <florian@rivoal.net>
Date: Sun, 24 Jan 2016 21:40:27 +0900
Message-Id: <762593F4-BDC7-4F77-B958-1593A787195C@rivoal.net>
To: CSS public list <www-style@w3.org>

Maybe I'm not reading it carefully enough, but it seems to me that neither spec is clear about whether it is possible to use scroll-snap-align on the scroll container itself.

For example, can you do this?

div {
  height: 100px;
  overflow: scroll;
  scroll-snap-type: mandatory;
  scroll-snap-align: center;

or this?

div {
  height: 100px;
  overflow: scroll;
  scroll-snap-type: proximity;
  scroll-snap-align: end;

I assume that it does not work, because if it did, it would cause issues in the case of nested scrollers. The spec(s) should be (more) explicit about that.

It does seem a little bit unfortunate though, because if we don't provide it, people who want that will be able to achieve it anyway by adding meaningless wrapper divs to their markup and putting the overflow and scroll-span-type properties on the wrapper, and I'd rather avoid encouraging wrapper divs. If we do allow it, we would need to specify that normally keys off the border box of the element on which the snap point is placed needs to key off the content box instead, since the border is outside the scroller. Maybe this difference further weights against allowing it, but then again it is easy resolved, so I am not sure.

 - Florian
Received on Sunday, 24 January 2016 12:40:52 UTC

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