Site-specific stylesheets

A new thing that’s coming around, I think perhaps down to Eric Meyer, is giving the body tag of your pages an ID related to your URL so that people can create styles in their user sheets that specifically tackle issues they might have with your site. E.g. this site now has <body id="aftnn-org">, you can put a style like the following in your user sheet, if you can’t read my fonts:

body#aftnn-org * { font-size: larger; }

This idea found it’s way to www-style today. Apparently something similar has been proposed before, in 1999! Way to go W3C. This would be a valuable technology for users with accessibility problems to leverage. It’s a bandaid, yes, but one which empowers the user to make good on the individual mistakes of each author. However, it’s only valuable if those users can actually find and use the feature. At the moment there is no form of site-specific syntax in CSS itself (although it does lend itself to the above hack) and I think that a push from the W3C will be required if this is to help the minority of users who really need it. It gives user sheets the power they really need to be useful.

I’m arguing in favour of the addition of something along the lines of:

@scope url="http://www.yahoo.com" {

color: red;
}

Which is very close to the original proposal, but we’ve been discussing some potential enhancements as well.