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

Hi,

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