Skip to content

[css-overflow-5] Tree structure of scroll container controls #11125

@flackr

Description

@flackr

::scroll-marker-group and ::scroll-button(*) are pseudo elements that originate from the scrolling container. These elements should not move with scrolling content as they are meant for navigating the scroller. Structurally we need to decide if they are children of the originating element scrolling container (like most existing pseudo-elements), or whether they should be siblings.

Options:

  1. They are normal children. Developers need to switch to a different positioning model that makes them not contained by (or shifted by) the scrolling content of the scrolling container. E.g. position: fixed or position: absolute (as long as the scroller isn't position: relative), or anchor positioned. It is impossible to reserve space for them outside of the scroller.
  2. They are siblings before/after the scroller. They can reserve space in the flow of the scroller's container, possibly be positioned into grid areas or participate in ancestor flexbox sizing. Additionally like other siblings their in flow position is outside of the box of the scrolling container.
  3. They are children of the scrolling container but not part of the scrolling content, instead being considered part of the box model for the scrolling container itself (and thus not scrolled by it). We'd have to think more about how exactly this would work (i.e. outside border? inside border? inside padding?) and render, but conceptually they would be part of the box of the scrolling container.

Demo of the approximate layout of the different approaches with minimal extra position styling:
https://flackr.github.io/carousel/examples/pseudo-structure/

I propose that we go with option 2 as it's easy to understand and I think sets up a lot of the right structure by default.

@tabatkins

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions