Re: [css3-values] Interaction of vw/vh and scrollbars

On Thu, Jan 24, 2013 at 1:22 PM, Markus Ernst <derernst@gmx.ch> wrote:
> I understand that vh is more intuitive to not reserve space for a scroll
> bar, at least as long as there is none. This applies for vw, too, but
> actually it makes vw pretty useless:
> - With overflow:hidden or scroll, it behaves the same as %

Incorrect.  It behaves the same as % *if all of the element's
ancestors, all the way to <html>, are width:100%*.  If that's not
true, then they're not equivalent.  The fact that it's so rarely true
is the reason we invented the viewport units.


> - With overflow:auto, it is actually not useable, as width=100vw will
> trigger a horizontal scrollbar if a vertical one occurs.

Correct.  So you can set overflow-y:scroll to make 100vw not cause
horizontal overflow.


> OTOH, vh is really useful and necessary. In my understanding, it would be
> intuitive and okay for vh to shrink to the scrollbar, if present (as we know
> it from width=100%).

We don't know anything of the sort.  We can't tell if a horizontal
scrollbar will be created until we do the page's full layout.


> Unlike for width, this does not seem to have unwanted
> effects for height, while the suggested behavior for overflow:auto seems
> suboptimal to me, also in the case of vh (it also triggers a vertical
> scrollbar if height=100vh and a horizontal scrollbar appears).
>
> I am inclined to suggest to totally drop vw in favor of an optimal spec for
> vh.

Oh jeez, I'd super-object to that.  ^_^

~TJ

Received on Thursday, 24 January 2013 21:38:25 UTC