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

On Thu, Jan 24, 2013 at 12:15 AM, Markus Ernst <derernst@gmx.ch> wrote:
> May I humbly suggest the opposite from my author's POV. It seems to me that
> it would be desirable to have the scrollbar size subtracted when overflow is
> set to "auto".
>
> One main reason to use vw rather than % is to prevent centered designs from
> "jumping" horizontally when navigating between pages with or without
> scrollbars.

Interesting, I wasn't aware of that as a use-case.  (I've always just
used it for when I want an object to be a fraction of the screen, but
its direct ancestors aren't all locked to "height:100%; width:100%;".)

> No authors want their content to be covered by scrollbars, and if authors
> wanted to force scrollbars, they could also do this using %. So, if vw
> ignores the scrollbar width when overflow is "auto", authors will end up
> setting right margins or paddings to prevent the content to be covered by
> scrollbars, which results in wasting space on devices with other scrolling
> mechanisms.

Or they'll set "overflow-y: scroll;" to force a vertical scrollbar,
which is perfectly acceptable in this circumstance (where different
pages may be long enough to trigger a scrollbar or not).  Then vw uses
the adjusted width, while vh continues to do what one would expect and
fills the screen.

fantasai, I think it would be reasonable to put an explicit reference
in the vw/vh section to the overflow-x/y properties, to point out to
people that they should use those to change the behavior when they
want it.  I think most people aren't aware that the subproperties
exist, or (like me) think that they're still proprietary.

~TJ

Received on Thursday, 24 January 2013 17:59:48 UTC