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

Am 24.01.2013 07:23 schrieb Rossen Atanassov:
>> From: Tab Atkins Jr. [mailto:jackalmage@gmail.com]
>> Sent: Tuesday, January 22, 2013 6:34 PM
>
>> In that case, I acknowledge that there's a reasonable user-safety argument
>> for making "auto" act like "hidden" in both dimensions.
>
> I too agree that ignoring the size of scrollbars when overflow is "auto" makes more
> sense than accounting for them. As you mentioned, if authors really expect to have
> scrollbars on the viewport and they're using viewport units they can simply specify
> overflow:sroll and be done with it.

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.

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.

OTOH, if the scrollbar width is subtracted by default, vw is a 
rock-solid and easy-to-use alternative to %.

(An alternative, even better solution would be to invent a unit for the 
scrollbar-adjusted width of any element, not only the viewport.)

Received on Thursday, 24 January 2013 08:16:20 UTC