Skip to content

[css-position] sticky positioning - should definition of 'position box' refer to 'border edge' instead of 'margin edge'? #11423

@sliepke

Description

@sliepke

Hello, I am having a strange time interpreting the definition of a sticky box's position box.

According to the spec, a sticky box's position is visually shifted "insofar as it can while its position box remains contained within its containing block. The position box is its margin box, except that for any side for which the distance between its margin edge and the corresponding edge of its containing block is less than its corresponding margin, that distance is used in place of that margin."

I assume that the position box sizes are determined before applying offsets? If this is the case, then it leads to not respecting margins of sticky boxes even when that box's margins do not overflow its containing block, as in the following example:

1

And if the distance used in place of the margin can be negative (which I think is what is meant), then it can also lead to unnecessarily pushing the sticky box's content past its containing block as well:

2

In either case, the alternative definition seems to corresponds with when (at least my browser) stops shifting sticky positioned boxes, and seems to make sense as it basically respects the margins to the extent that they have been respected by the layout prior to any position offsetting. It's possible that's what the intended meaning is and I'm being overly pedantic but I'm not 100% sure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions