Many modern Web
browsers allow users to set their own CSS
stylesheets for accessibility purposes. It can be difficult to write a comprehensive
accessibility stylesheet by hand, especially if you
want to work around browser bugs and the
difficulties posed by
complex websites. So I made a stylesheet generator program
in Python which generates user CSS files that
are hundreds of lines long and contain workarounds
for many problems.
If you are a programmer, you can download the
program (above) and adjust it to your needs.
Alternatively, you can try one of these presets:
I've received several emails from people who don't
need to change the size or layout, but just reduce
the brightness of bright backgrounds. Effective CSS
accessibility usually means
changing everything; CSS was not designed
to say "if the text is light on dark then leave it
alone, but if it's dark on light then reduce the
brightness". You could use Javascript instead, for
example the
"zap
white background" userscript works in Opera, in
Firefox with the Greasemonkey add-on, or as a
bookmark.
What is the best pixel size?
You could just experiment, but if you
frequently change between different
setups and/or have variable sight
then it might help to know how to
choose a size without constantly re-experimenting:
You need to know
the best size in points (36, 48 or whatever) for text you
read at the distance of the screen.
First you need to know your normal distance to the screen. You can move the screen nearer, but the limits will
vary with the type of mounting and the size of your
keyboard, desk, chair, etc; you need to be aware of this
variation if you use different computers. Also, if you
have variable sight, remember to allow yourself room to get
even nearer when your sight is worse (and without hurting
your posture too much), which is usually easier than
temporary size changes.
Divide the screen's distance by
your normal reading distance for printed text (both measured from your eyes to the text itself, ignoring any magnifying device in between), and multiply
by the size in points of the printed text you prefer to
read.
If you normally use a magnifier for printed
text but cannot use it for the screen, multiply your answer by the scale factor of this magnifier.
If you have a full-screen magnifier (fresnel lens) permanently mounted to the screen, then divide your answer by the scale factor of this magnifier.
Do not try to work out your size by setting the
``point size'' on the screen of a wordprocessor or similar,
because that might not be calibrated correctly.
Let P be your
on-screen point size, H and V be the horizontal and vertical
resolution of
your monitor,
and D be its size in inches (measure across the diagonal if
you don't know, and if you're on a CRT
monitor then you should subtract about
an inch from the rated figure whereas
TFT monitors' figures are OK as they are). Your pixel size is
the square root of (H*H + V*V), divided by D, multiplied by P and
divided by 72.
(If your monitor has the standard 4x3 aspect ratio then this
simplifies to P*V/D * 5/216.)
In some cases you may then need to adjust for browser scaling of
pixels; see "note on browser bugs" below.
How to install a stylesheet
Save the stylesheet to a file on your disk, and:
Firefox:
Locate your profile directory as
described on mozilla.org, and save the file as
userContent.css in the chrome subdirectory
of your profile directory (if no chrome subdirectory exists, create
it).
Internet Explorer:
Go to Tools / Internet Options / Accessibility
and set that file as a user-supplied
stylesheet. If you are using a low
resolution or a high DPI setting as a means of
getting Windows to magnify consistently, and if
as a result of this the dialogue boxes won't
entirely fit on your screen, you may
be able to reach Accessibility by clicking on
General in Tools/Internet Options, pressing Tab
13 times (in IE6) or 12 times (in IE7), and pressing Enter. But this is
likely to change in different versions of IE.
Safari:
Go to Safari / Preferences / Advanced / Style
sheet, select Other, and select the file
Konqueror:
Go to ``Settings'', ``Configure Konqueror'', ``Stylesheets'',
``user-defined stylesheet'' and set the filename. You may have to restart
Konqueror.
Galeon:
Go to Settings / Preferences / Rendering /
Fonts/Colours / Stylesheets / Add, and enter
that file as a user-supplied stylesheet, or save
it to
~/.galeon/mozilla/galeon/chrome/userContent.css
and restart Galeon
OLPC browser:
Save the file as ~/.sugar/default/gecko/user-stylesheet.css and
restart. (When calculating the best stylesheet size, remember the
OLPC's screen is 1200x900 and 7.5 inches.)
Note on browser bugs etc
Some versions of some browsers contain bugs that
manifest themselves when these stylesheets are
used, or have other unexpected behaviour you might need to know
about. You may need the following workarounds:
Some versions of Firefox 3 on Windows scale their pixels at
high DPI settings, so the stylesheet size needs to be reduced to
compensate.
You might need to set text and background
colours and check ``always use
these colours'' as well as having the
stylesheet, e.g. with some versions of Mozilla and
Galeon. In other browsers (e.g. Internet
Explorer) you shouldn't do this because
it will override the stylesheet.
Some versions of Firefox 2 on Windows
display a white background around the page
(so any overspill text that is not dark will
become unreadable) unless you go into
high contrast mode. However if you then
come out of high contrast mode, the fix will
persist. (High contrast mode is a nice
idea but it does break a lot of applications.)
Some versions of Mozilla (around 1.2)
incorrectly scale their ``pixels'' to a
different size depending on the DPI setting in X
Freetype library. If you can't upgrade
then you may have to change your stylesheet size
to compensate. If you know the DPI setting
(if you're using my .Xresources file, it's near
the beginning of that file) then divide your
pixel size by this number and multiply by 75 to
get the size to use. You should also edit
the appropriate stylesheet file and look for all
instances of max-width and change its
value (multiply by the DPI value and divide by
75). Remember to re-do the stylesheet if
you upgrade Mozilla later.
Some versions of Windows XP
will override this stylesheet when in high
contrast mode, and the result is not always
readable. You may have to come out of high
contrast mode when browsing.