2 ms·
Also the vw/vh units are fundamentally broken, including viewport scrollbars, so that 100vw is wider than the viewport if there’s a vertical scrollbar and you’r
by chrismorgan 4y ago
Also the vw/vh units are fundamentally broken, including viewport scrollbars, so that 100vw is wider than the viewport if there’s a vertical scrollbar and you’re on a platform where scrollbars take space (which is still most desktop platforms), thus triggering a horizontal scrollbar. Long ago the spec had a cumbersome and mildly imperfect solution for this, but only Firefox implemented it, and no one else wanted to so they eventually ripped it out of the spec and Firefox and left us with fundamentally broken units. Then they made new versions of the units to deal with the ways in which they were broken in ways that were a bit fiddly to deal with on mobile platforms, but completely ignored the way they were still completely broken on most desktop platforms. Sigh.
In short: viewport units are always wrong if you can have scrollbars, containing up to about 4% of error (though much more is theoretically possible). It is possible to use them safely, but the trouble is that most places where you actually want them can’t tolerate that error, so in practice they’re almost useless.