Re: [csswg-drafts] [css-values-4] Clarify viewport sizes with overflow: scroll on the root element (#12518)

Thanks @Loirooriol 

So the behavior is stated quite clearly in the [resolution](https://github.com/w3c/csswg-drafts/issues/6026#issuecomment-1832443514) text:

>  if overflow:scroll is set on the root element (not propagated from body), account for the default scrollbar width in the size of vw.

In practice, this means that if `overflow: scroll` is applied directly to the root element and the viewport is 1000px wide with an 18px scrollbar on the side, the browser still treats the viewport as 1000px wide (100vw = 1000px), even though only 982px are actually visible.

This behavior doesn't seem consistent with the statement:

> "**The computed values of the viewport-percentage lengths in that axis are reduced in accordance with the initial containing block.**"

or at least, the behavior isn't clearly conveyed.

Please consider updating the spec to more explicitly reflect the behavior described in the resolution text above.


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


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

Received on Thursday, 24 July 2025 10:09:59 UTC