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

[css-snappoints][css-scroll-snap] Does scroll-snap-align applies to pseudo-elements?

From: Florian Rivoal <florian@rivoal.net>
Date: Sun, 24 Jan 2016 21:59:18 +0900
Message-Id: <0849C120-C683-4AC2-9811-32502F3442B4@rivoal.net>
To: CSS public list <www-style@w3.org>
The spec(s) do not explicitly allow scroll-snap-align and related properties on pseudo-elements, but I see no particular difficulty in allowing them, and it seems useful.

I think they should at least work on the generated content ::before and ::after pseudos, but I'd also be in favor of making it apply to all pseudo elements. As long as something has a box, we should have all we need to make things work.

The following example may be somewhat outside of typical use cases, but it doesn't seem insane, and there's no doubt about what it would do:

.spell-check-mode {
  scroll-snap-type: proximity;

}

.spell-check-mode *::spelling-error {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  scroll-snap-margin: 1em;
}

 - Florian
Received on Sunday, 24 January 2016 12:59:44 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:35 UTC