Christian Heilmann

You are currently browsing the Christian Heilmann blog archives for February, 2005.

Archive for February, 2005

Comment spam

Friday, February 11th, 2005

The gall of some people is just unbelievable. I am getting spammed in the comments here with faked emails. The messages end in “If you don’t want us to comment here, email us at $fakedemail”.
Why is it that free options just don’t get any respect?

CSS constants

Friday, February 11th, 2005

A lot of web designers complain about CSS lacking constants you could define once and reuse throughout the CSS document. CSS was not meant for that and does not support it.
What you can do though is use a server side language to simulate a CSS file by setting the appropriate header. However, this means you need to stick to the language syntax.

Playing with that idea, I came up with a small PHP script that parses any CSS given to it via a variable and reads and replaces the defined constants in the CSS.

This page shows how it can be used. You apply the CSS with the invalid constants syntax by looping it through the PHP script:

In the CSS file, you define the constants with the following syntax:
$colour1 = '#999';
$colour2 = '#363';
$colour4 = '#696';
$colour3 = '#cfc';

And you can use them throughout the whole CSS document:

#footer{
padding:.2em .5em;
margin:0;
background:$colour1;
}

Any improvements?

I am aware that this is butchering the idea of CSS as presentation only, and means you design invalid CSS in the raw form, but it fills a gap and it might make CSS maintenance a bit easier. You can still validate your CSS by looping it through the script:
http://icant.co.uk/articles/cssconstants/cssconst.php?c=demo.css.

Rewind, Reboot

Thursday, February 10th, 2005

My personal copy of Norton Internet Security arrived. Jesus I hate all that installing and rebooting. Maybe I just switch to linux soon.

what a wonderful day

Tuesday, February 8th, 2005

It was sunny and nice today, so I decided to buy a bicycle and explore the city. London seems to be 90% uphill, I know that now.

When I came back I got an email from my ISP about a possible Virus infection, although I got AVG Free Edition running. I checked with the Symantec online checker, and suprise surprise, some trojans were there. Now I ordered my suite and feel like asking Microsoft to sponsor it. The only reason I deal with this crap instead of installing linux and get it over with is that my visitors and clients do use windows, and I need to replicate their environment to see where bugs occur. Now, as Microsoft is able to sell the most, partly because the OS is so easy to extend with some programming knowledge, they should also pay for us to keep it secure. Personally I really don’t see why anyone would write a virus for Windows, other than getting money for it or working for an antivirus company. There is no challenge to it…

Internet Explorer vs. Mozilla #12133

Thursday, February 3rd, 2005

There is a wonderful tongue-in-cheek comparison of Fx and MSIE on BBSpot. For a change, it does not compare the technicalities of the two browsers, but the things that really matter, like the stereotypical users and if it can help you to get laid.