Re: [csswg-drafts] [css-position-3] Sticky position and margins (should margins be considered at all?). (#9052)

Returning to alternative solutions for defining the "sticky constraint rectangle":

Currently the sticky positioned element is shifted to stay within the sticky view rectangle insofar its possible while staying within its containing block inset by its margins (simplified). In other words, sticky pos operates with two insets, one inset from its scrollport, and one inset from its containing block. If margins are no longer to be considered, authors have no way of controlling that second inset.

I'm wondering if the box insets could be extended to support multiple named insets, to give a way of controlling the inset from the containing block?

```css
/* 
Make element sticky against scrollport 
insofar as it can while staying 20px within its containing block 
*/
position: sticky;
inset-block: 
  scrollport 0px,
  containing-block 20px;
```

This could solve issue one in https://github.com/w3c/csswg-drafts/issues/2496.

(A `position-container` property as mentioned in https://github.com/w3c/csswg-drafts/issues/9868 could solve issue 2 by allowing you to change the containing block.)

-- 
GitHub Notification of comment by johannesodland
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9052#issuecomment-2252283056 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 26 July 2024 08:57:03 UTC