29 May 2006

A funny "Stylish" style sheet

My girl friend is learning Java and browsing the apis a lot. Lately she complained that it should be possible to just see the classes and interfaces you have already visited in the lower left frame, because it often happens that you need to visit the same class more than once and it makes searching in those thousands and thousands of classes easier. So I thought that that should be fairly easy and started looking around. Then I found Stylish, a Firefox extension similar to GreaseMonkey but for CSS instead of JavaScript. I wrote the following style:


@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document url(http://java.sun.com/j2se/1.5.0/docs/api/allclasses-frame.html) {
a {
display: none !important;
}
a:visited {
display: inline !important;
}
br {
display: none !important;
}
td {
white-space: normal !important;
}
}

@-moz-document url-prefix(http://java.sun.com/j2se/1.5.0/docs/api) {
}


Note the seemingly useless second part that applies the empty ruleset to all pages under the apis hierarchy. It's there to make sure that you can turn it on and off with just a two clicks: Stylish otherwise doesn't put it into its popup menu.

0 Comments:

Post a Comment

<< Home