W3C home > Mailing lists > Public > public-css-archive@w3.org > July 2021

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

From: Bramus! via GitHub <sysbot+gh@w3.org>
Date: Wed, 28 Jul 2021 12:59:38 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-888288307-1627477176-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:39 UTC