Skip to content

[css-scroll-snap] Undefined alignment when snap area or snapport is degenerate (zero/negative size) #14103

Description

@nwidynski

scroll-snap-align resolution assumes a positive-size snap area and snapport. Two reachable cases break that:

  1. Inverted Snap port — scroll-padding add past the scrollport. E.g. 100px container, scroll-padding-top: 80px; scroll-padding-bottom: 40px

  2. Inverted Snap area — negative scroll-margin values cross.

In both, start/end/center alignment is undefined: the edges the algorithm aligns to have crossed, so the resulting snap position is implementation-dependent.

Should the spec clamp degenerate snap areas/snapports to zero size (and define alignment against the collapsed edge), or define edge priority explicitly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions