Archive: February 1st, 2002

More tinkering with themes

In a previous entry, I was lamenting the fact that each of my themes relies on two different stylesheets which effectively rules out using an on-the-fly style switcher.

Well, Paul Sowden comes to my rescue. He writes:

"You should add the @import rule to the begining of each external sheet.

The document would have a list of alternate sheets, and inside each of the alternate sheets that are linked (the basic ones) you put the @import rule linking to the more advanced sheet on the first line.

Hey presto, old browsers are happy, new browsers are happy, and people can change sheets actually "on the fly"."

Excuse me while I slap my forehead: it’s so obvious now that somebody has pointed it out to me.

Thanks, Paul.

StartupSounds

I love my Mac but I don’t think I’m quite ready to compose an entire opus about it.

Still, I think it’s pretty nifty that you can recycle an iMac box as a bass drum.

-={ PaPeR bOaTs }=-

The newest story over at thecouch.org is not only very well written, it has some great photos of Brighton’s wonderful west pier.

I just found out that the guy who runs the site also runs the local Mac Users Group which I’ve just joined. I’m looking forward to meeting him in person at the next gathering.

Tinkering with the themes

Hopefully, you won’t notice anything different but I’ve been tinkering with the stylesheets for the various themes for the site.

After I read this piece at frownland, I realised I was kind of cheating with my theme-switching widget. I was using server-side code (PHP) to change the "eyecandy" for each theme.

Now, I think I’ve managed to achieve a fairly complete seperation of style and content. In fact, I would be able to use the excellent one-click style-switching widget if it weren’t for the fact that each theme uses two stylesheets.

I use <link> to call up one stylesheet with all the basic stuff (fonts, colours, etc.) that even Netscape 4 can understand. I use @import for the second stylesheet which has all the fancy positioning stuff.

That way, older browsers that don’t understand @import just get the basic styles.

The only fly in the ointment is Internet Explorer 4.5 for the Mac. It *thinks* it understands @import but then proceeds to totally mangle the styles.

A non-compliant browser that thinks it is standards-compliant. It is, as a friend of mine put it, "the worst kind of idiot".