A partial archive of discourse.wicg.io as of Saturday February 24, 2024.

Built-in vertical scrollbar

richarddunnebsc
2021-08-29

On webpage creation, a CSS width of 100% does not include a vertical scrollbar. Yet as soon as the page content height reaches more than 100%, it does. In terms of visibility, the initial width of 100% without a vertical scrollbar becomes 98% (approx) with the vertical scrollbar. In order to see any content behind the vertical scrollbar, to see 99% width or more, the horizontal scrollbar is needed.
The % of webpages that do not have a vertical scrollbar is miniscule, so, with that in mind I am proposing two things, 1) A built-in, non-active, transparent vertical scrollbar on page creation, that only becomes non-transparent and active when content height exceeds 100%, 2) On page creation, the horizontal width of 100% not include the vertical scrollbar, that way, the horizontal scrollbar only appears when the content width exceeds 100%, not at 99% as it currently does when the vertical scrollbar is active.

isiahmeadows
2021-09-01

Better would be a sb unit representing scrollbar width and a :scrollable pseudoclass so I could change the style depending on whether the element is actually scrollable.

Also, a standardized ::scrollbar pseudoelement would be nice, and sb would of course be relative to that. (The default stylesheet and sb size would, for obvious reasons, be necessarily implementation-defined.)

simevidas
2021-09-05

That sounds like scrollbar-gutter: stable.