Hi Harry,
Polystyrene, as you said, has poor chemical resistance. Copolymerizing it with acrylonitrile increases the chemical resistance markedly and the higher the proportion of acrylonitrile, the better the chemical resistance.
As an example, SAN is used in Chapstick tubes because polystyrene fails due to poor chemical resistance. SAN is even used in some batteries where very good chemical resistance is needed.
Standard SAN has 24% acrylonitrile because by chance styrene and acrylonitrile form an azeotropic mixture at that ratio so polymerizing while keeping monomer content constant is easy (non-chemists please forgive this detail).
SAN with lower AN is available, for example with only 19%, and it's a little cheaper with poorer chemical resistance.
SAN with up to around 33% acrylonitrile in the copolymer is also available and has much better chemical resistance. Another benefit of copolymerising with AN includes an increase in strength.
While ABS is usually made with SAN using 24% AN, ASA, at least the grades I know of, use SAN with 30-33% AN and that gives a boost in chemical resistance.
When you think about it, it makes sense for a couple of reasons. First, polystyrene is quite low polarity and is therefore attacked by low to medium polarity solvents. Acrylonitrile is very high polarity, so using that as a comonomer shifts the types of solvents that can attack or dissolve the polymer. Most compelling of all is that pure polyacrylonitrile is amazingly resistance and insoluble in practically everything.
MABS (SAN with impact modifier but still transparent) is used for electric toothbrushes because of its chemical resistance and also by Channel for cosmetics for the same reason.
Chris DeArmitt PhD FRSC CChem
Consultant to the plastics industry