Skip to content

[css-scroll-snap-2] Why does scroll-start-target have separate block and inline values? #8832

Open
@flackr

Description

@flackr

css-scroll-snap-2 scroll-start-target lets you define any element to be the starting position in either or both the block and inline axes. Does it ever make sense that you would want to scroll to one element in the block axis and a different one in the inline axis? Doing this could result in both of the targets not being visible, e.g.

<style>
#a, #b {
  position: absolute;
}
#a {
  scroll-start: none auto;
  left: 300vw;
}
#b {
  scroll-start: auto none;
  top: 300vh;
}
<div id="a"></div>
<div id="b"></div>

The browser would scroll to (300vw, 300vh) resulting in neither element being in view.

Proposal: Assuming there are no use cases for this behavior, make scroll-start-target a single value property which scrolls to the target in both or neither axes.

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