W3C home > Mailing lists > Public > www-style@w3.org > January 2013

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 24 Jan 2013 09:59:02 -0800
Message-ID: <CAAWBYDBLK4AQHPgDUhsGP-aDMwtqJNreytsiWi6QRQ3TvqObxg@mail.gmail.com>
To: Markus Ernst <derernst@gmx.ch>
Cc: Rossen Atanassov <Rossen.Atanassov@microsoft.com>, fantasai <fantasai.lists@inkedblade.net>, www-style list <www-style@w3.org>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:04 GMT