[csswg-drafts] [css-overflow] Proposing `scroll-start`: allowing overflow scroll to not always start at 0 on 1st layout pass (#6986)

argyleink has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-overflow] Proposing `scroll-start`: allowing overflow scroll to not always start at 0 on 1st layout pass ==
📄  [Explainer](https://github.com/argyleink/ScrollSnapExplainers/tree/main/css-scroll-start)

Currently, JavaScript needs to show up at "never the right time" to adjust a scroll position to a specific starting place. This CSS property proposal seeks to remedy page load scroll jank by allow specifying a `scroll-start` position with a specific <length> or by giving a child element `scroll-start-target: auto` at which point an absolute length is derived from the element and the scroll direction. 

<br>

**Example**: set the start position to an absolute value:

```css
:root { --nav-height: 100px }

.snap-scroll-y {
  scroll-start-y: var(--nav-height);
}
```

<br>

**Example**: set the start position to a snap child

```css
.snap-scroll-inline {
  overflow-inline: scroll;
  scroll-snap-type: inline mandatory;
}

.snap-scroll-inline > #snap-start {
  scroll-start-target-inline: auto;
}
```

<br>

There's a lot more use cases and details (like interaction with [fragment navigation](https://html.spec.whatwg.org/multipage/browsing-the-web.html#scroll-to-fragid)) about the proposal in the [Explainer](https://github.com/argyleink/ScrollSnapExplainers/tree/main/css-scroll-start)

Would love to present the details of the explainer to the CSSWG for feedback 🙂 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6986 using your GitHub account


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

Received on Tuesday, 25 January 2022 20:33:40 UTC