Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sliepke opened this issue Dec 31, 2024 · 0 comments
Labels
css-position-3 Current Work

Comments

@sliepke
Copy link

sliepke commented Dec 31, 2024

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.

@sliepke sliepke closed this as completed Dec 31, 2024
@sliepke sliepke changed the title [css-position] sticky positioning - should definition of 'position box' refer to 'border edge' instead of 'margin edge [css-position] sticky positioning - should definition of 'position box' refer to 'border edge' instead of 'margin edge'? Dec 31, 2024
@sliepke sliepke reopened this Dec 31, 2024
@Loirooriol Loirooriol added the css-position-3 Current Work label Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-position-3 Current Work
Projects
None yet
Development

No branches or pull requests

2 participants