W3C home > Mailing lists > Public > w3c-wai-gl@w3.org > April to June 2015

Re: Viewport Units for font sizes

From: Alastair Campbell <acampbell@nomensa.com>
Date: Tue, 14 Apr 2015 18:12:21 +0100
To: Eric Eggert <ee@w3.org>, WCAG <w3c-wai-gl@w3.org>
Message-ID: <D152FF02.23306%acampbell@nomensa.com>
Hi Eric,

Thatís a good point, Iíve been put off using VW for text myself, partly for that accessibility reason, and partly it can be complex to manage across devices.

NB: I think you malign pixels as a unit, it is probably the best cross-device unit to use [1], but thatís an aside.

For turning the car around, I would have thought it needs a mechanism to vary according to user preference? I.e. Pressing cntl + makes the text bigger.

However, that strikes me as a user-agent change rather than developer change.

The point of the unit is to be relative to the window size, for example, including a panel that is a proportion of the window size, and text within it that scales with the panel.

This is a problem when you assume the user has a large window and it is actually small (like your example), and because the text size cannot be adjusted if you are at the maximum window size already. It occurs to me now that any use of the VW/VH units on text would then automatically fail 1.4.4.

I donít know if there is a solution that maintains the reason for having the unit? The point is that it scales for the window, like setting percentages for layout. Most articles Iíve read about it are applying the units to <div>s or images rather than text, but Iím sure some people do apply it to text already.

Possible solutions include:

 *   User-agents disregard the unit for sizing text (may break current usage).
 *   User-agents allow the unit for sizing text, but allow the user to scale it (may break current usage in ways people donít notice immediately).
 *   Developers have to use a work around, such as media queries for dealing with different window sizes, and JavaScript to detect text-size changes (if that is possible).

Either way I think you are right, there should be a failure for using VW/VH on text.


1] https://alastairc.ac/2013/02/how-to-hold-your-ipad/

From: Eric Eggert
Date: Tuesday, 14 April 2015 15:20
Subject: Viewport Units for font sizes

Hi all,

as it looks[1], viewport units for font-sizes would be great for responsive web design but apparently are not accessible at all because they are defined as fixed measurements Ė almost like pixels. And as the viewport is getting smaller when you zoom in, the calculated font size stays the same.

Take a look at this example and try to scale it in a browser that supports viewport units[2]:


I wonder if people are aware of this and if we might to add a failure technique. I also wonder if we may be able to turn the car around and work out an implementation with CSS WG that allows implementationÖ (I donít know if there is a solution that removes the main benefit for people using low vision that they can get the mobile view on a desktop and donít need to scroll horizontally, if properly implemented.)

Best, Eric

[1] https://twitter.com/SaraSoueidan/status/587694001500872704
[2] http://caniuse.com/#feat=viewport-units


Eric Eggert
Web Accessibility Specialist
Web Accessibility Initiative (WAI) at Wold Wide Web Consortium (W3C)
Received on Tuesday, 14 April 2015 17:12:59 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 16 January 2018 15:34:19 UTC