WebAIM - Web Accessibility In Mind

E-mail List Archives



From: Tim Beadle
Date: May 29, 2008 3:50AM

On Thu, May 29, 2008 at 10:30 AM, Gareth Dart < <EMAIL REMOVED> > wrote:
> Georg wrote: "You _can_ also add a stylesheet switcher, as long as the
> basic stylesheet allows font-resizing in the browsers regardless of such
> a switcher. The simplest (and oldest) switch-version is found here...
> <http://www.alistapart.com/stories/alternate/>; ...but there are plenty
> of alternatives around."
> Another alternative, if you want to have text resizeable via elements on
> your page as well as built-in browser functionality, is to adjust the
> font size of the body tag via javascript onclick events: a common
> convention seems to be three links (A- A0 and A+).

The method descripted in http://www.alistapart.com/stories/alternate/
is the best of both worlds:

* You include alternate stylesheets using link elements, which
Mozilla-based browsers (and others?) make available via the "View ->
Page Style" menu
* You then unobtrusively attach a Javascript style-sheet switcher that
inspects the link elements in the head of the page and adds the
resizer widget, populated with data from the link elements. This also
adheres to the DRY (Don't Repeat Yourself) principle.

> You can even go a step further and store the user's preference in a
> cookie, which your pages then read when they load and apply the
> appropriate style.

This is a good idea.

> It's also wise to have these links written to the screen via javascript
> rather than text markup, so if your user is one of the ~1 in 20 who does
> not have javascript enabled (or just has a non-js browser), then there
> won't be three useless and confusing links just sitting there. A text
> equivalent for the script content could usefully be a link to guidance
> on how to resize text in major browsers.

Indeed - unobtrusive scripting is the only acceptable way these days.

> That said, I've seen this sort of thing around less and less recently.
> I'm sure that a major reason for this is the increasing user-awareness
> of built-in text resizing capabilities, but if there's some other reason
> why they seem to be on the wane, I'd love to know.

There does seem to have been a trend away from them by developers - as
Shawn pointed out, it's potentially better to teach users how to fish.
Also, newer browsers (IE7, Firefox 3, Opera) can zoom the *page* as
well as the text, making it all rather moot, in addition to Joe
Clark's assertion in "When accessibility is not your problem" [1] that
if someone really needs to make the text larger, they'll be using a
screen magnifier.


[1] http://joeclark.org/appearances/atmedia2007/#fonts