A CSS Wish

Here's something I'm looking for. I want the ability to style sites the way I want. For example, the new Wired site is designed so that it's entire presentation is controlled by CSS stylesheet rules. Well, I happen to like the way it looks, but maybe I want it to use a slightly different color scheme. Or perhaps a different font for the sidebar. Or maybe I want to adjust the line spacing for the articles? Well, I realize that both the Internet Explorer and Mozilla browsers allow a user-defined stylesheet. But here's the problem: I don't want these custom CSS rules to be applied to ALL sites, just to wired.com.

This may never happen for Internet Explorer, but considering that Mozilla is open source and all, I could see a new mozdev.org project for this feature. I'd write it myself, but I have absolutely no experience developing with Mozilla. It's something I really want though, so I may have to take that plunge if someone doesn't beat me to it.

Another approach to this feature would be to use a proxy engine. The Proxomitron would work-- it's customizable enough that it could do this, and it will work with Internet Explorer. But I'd still prefer a native Mozilla extension.

Update: Yes, the Proxomitron can do this trick. Creating a custom web page filter for Wired.com:

URL Match: *.wired.com
Matching Expression: http://*.akamai.net/*/www.wired.com/*/wnScreen.css
Replacement Text: http://bradchoate.com/play/wired.css

My custom stylesheet just so happens to hide a few of the ads and sets the font for the articles to Times New Roman. It inherits the existing stylesheets, but adds new CSS rules with the "!important" marker so they get enforced over the existing rules.


TrackBack URL for this entry:



Eric Meyer was talking about something very similar to what you'd like to do. To add the ability for users to use custom stylesheets for his web site, he's talked about giving the body tag a unique id. I think he's using something like id="www-meyerweb-com". I don't think I need to go any further for you to see what kind of power this gives to the user. If only more sites would do it...


samkat said:

Piro has developed a Mozilla XPI called "ContextMenu Extensions" at http://white.sakura.ne.jp/~piro/xul/_ctxextensions.html.en . It may give you the type of CSS power you are asking for. I am using it but am no expert on it yet.
As for Internet Explorer, I have no recommendations.


This article was published on October 23, 2002 11:59 AM.

The article previously posted was Dave's MT Outliner.

The next article is Valid RSS 0.91 feeds from Movable Type.

Many more can be found on the home page or by looking through the archives.

Powered by Movable Type