Re: [csswg-drafts] [css-overscroll] `position: sticky` elements should not move during overscroll when in stuck state (#8309)

Not the cleanest solution, but negative margins can be used to "combat" blocks being unstuck from their constrained box offsets during overscroll in **webkit**/**gecko**. You just also need to offset the opposing margin to keep the rest of the flow sane, **as well as** keep in mind that this compensating opposite margin will affect where the block becomes unstuck when reaching the opposing edge of its containing block.

eg
```css
body {
  background: #f99;
  margin: 0;
}
nav {
  height: 10vh;
  background: #9ff;
  position: sticky;
  top: 0;
  margin-top: -100vh;
  margin-bottom: 100vh;
}
main {
  height: 200vh;
  background: #99f;
  border-top: 5vh solid #999;
}
```

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


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

Received on Friday, 24 February 2023 08:08:58 UTC