Re: [csswg-drafts] [css-env-2] env(scrollbar-inline-size) (#4691)

With [[css-overflow-4] `scrollbar-gutter`](https://drafts.csswg.org/css-overflow-4/#scrollbar-gutter-property) making it possible to prevent unwanted Layout Shifts caused by scrollbars, what does the future of `env(scrollbar-inline-size)` look like?

I mean, getting the size of the scrollbar is handy, but as we can achieve the same behavior with `scrollbar-gutter: stable both-edges;`, do we still need `env(scrollbar-inline-size)`?

```css
/* Keep content centered by manually offsetting the padding-inline-start */
.keep-content-centered-using-envvar {
  padding-inline-start: env(scrollbar-inline-size);
}

/* Keep content centered using scrollbar-gutter */
.keep-content-centered-using-scrollbar-gutter {
  scrollbar-gutter: stable both-edges;
}
```

Or are there any other use-cases for `env(scrollbar-inline-size)` besides keeping things visually centered?

---

Also note that manually taking `env(scrollbar-inline-size)` into account can reproduce funky results when combined with `scrollbar-gutter: stable both-edges;`:

```css
/* This looks is a bad combination to do, as you'll end up with a double gap at the edge opposing the scrollbar */
.bad-combination {
  padding-inline-start: env(scrollbar-inline-size);
  scrollbar-gutter: stable both-edges;
}
```

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


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

Received on Wednesday, 28 July 2021 12:59:39 UTC