Re: Viewport Units for font sizes

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.

-Alastair

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


From: Eric Eggert
Date: Tuesday, 14 April 2015 15:20
To: WCAG
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]:

http://codepen.io/vcurd/full/ByerKw

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