Re: [csswg-drafts] [css-values] Use of 100vw is causing pointless horizontal scrollbars on some websites (#6026)

> Not very easy to do them auto-magically work because it'd be cyclic (declarations using vw units could cause scrollbars to appear which would change how vw would resolve).

Percentages are not cyclic now, so why couldn't `vw` (or new unit) be equivalent to "percentage of root element"? Every single time I've used `vw` units, I don't care one little bit how wide the viewport is if part of it is being covered by a scrollbar. I only care what part of the viewport I can "draw" the element in without causing horizontal scrolling. If my element is direct child of the body, this is super easy, `100%` (or just don't specify any width is element is block).

```html
<body>
  <div class="one" style="width: 100%;"></div>
  <div class="two" style="width: 50%;">
    <div class="two-child" style="width: 100vw;"></div>
  </div>
</body>
```

`.one` and `.two-child` should resolve as same exact width regardless of vertical scrollbar being visible or not. Can we make this happen somehow?

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


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

Received on Friday, 26 February 2021 21:55:14 UTC