Re: [csswg-drafts] [css-values-4] Visual viewport units (#7194)

> (@bfgeek) I believe based on https://bokand.github.io/demo/urlbarsize.html (and inserting a <textarea> or in the DOM to trigger the keyboard behaviour)

A forked version that includes this can be found at https://urlbarsize.netlify.app/urlbarsize-allowresize.html
It also contains an extra option to toggle the behavior of the Virtual Keyboard _(if supported by the browser)_.

> (@devongovett) I believe Chrome on Android has always resized the viewport when the keyboard appears, even with regular vh units.

Correct. It's the only platform that does this, and we'll be looking into that as part of https://github.com/web-platform-tests/interop-2022/issues/41

> (@bokand) A challenge with using a visual viewport unit to achieve these use cases is that the visual viewport also resizes (and offsets) as a result of pinch-zoom.

What if the zoom level was also exposed? Then an author would be able to reconstruct the “Unzoomed Visual Viewport” values from that:

- Unzoomed `vvh` = `calc(100vvh * 100vvz)`;
- Unzoomed `vvw` = `calc(100vvw * 100vvz)`;

_(`vvz` to be bikeshed, but you get the point)_

Alternatively `uvvh` and `uvvz` could be exposed, but that would – again – be extra units for the author to remember/use.

> (@bokand) IMHO, something like [position: device-fixed](https://www.quirksmode.org/blog/archives/2010/12/the_fifth_posit.html#:~:text=the%20user%20interaction.-,position%3A%20device%2Dfixed,-Which%20of%20these) seems more natural for these use cases

Also a fan of it :)

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


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

Received on Tuesday, 21 June 2022 09:15:10 UTC