You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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:
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.
The text was updated successfully, but these errors were encountered:
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
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:
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:
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.
The text was updated successfully, but these errors were encountered: