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

Would copy my comment from https://github.com/w3c/csswg-drafts/issues/6026, as it fits this issue more:

> In our product we're currently essentially calculating the `scrollbar-inline-size` via JS, creating an invisible block with an overflow, and retrieving its width if it has one, then storing it as a custom property on root, to be used in calculations.
>
> Being able to use a keyword for this, alongside a query to detect if scrollbars are present on a container would be very helpful.
>
> Why I'm mentioning “keyword” and “container” rather than an “environment variable” and “media query”: we have `scrollbar-width` which can control if we have the scrollbar, and we can have a container that _can_ be scrolled programmatically when it has `overflow: hidden`. That means that authors could want to a) detect if a certain scrollport has a visible scrollbar, and b) get the width of a scrollbar in that case, which can be different for different containers (`scrollbar-width` and also current webkit scrollbar pseudo-elements).


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


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

Received on Monday, 11 September 2023 11:42:47 UTC