weblog » tag view

2005 10 18

(the point to) server-side CSS

Rcss is an implementation of CSS SSC for Rails framework.
(It’s interesting to see that the description says “implements CSS-SSC in Ruby”, while the instructions specifically apply to Ruby on Rails. If confusion is growing between Ruby and Rails, does that make Rails the de facto framework for Ruby on the web?)

I’m not a big fan of server-side CSS as a tool for webdesigner, the point to them seems to lie mostly in customisation for end users. The reason is that it’s a tool to help with mass stylesheet modifications, a use case that is rather unusual in the real world for a single designer or team, and for which server-side CSS are a more like a punctual burden than a long term solution.
On the other hand, for people whose only will or technical ability is to change the fonts and colors used on their site, having a tool like Rcss modify some strings helps with customisability.

For example, a weblog platform could, in addition to a choice of templates, provide a way for end users to customise said their chosen template’s stylesheet; it would be cached as a static file. So aunt Maggie could use dear old Comic Sans for her headings and the host wouldn’t need to rebuild all her template files (like 20six currenly does, for instance).
Heck, themes for standalone apps could be distributed with a server-side CSS version, with defaults that could be overridden by the app (hello WP/MT/whatever themers). That would be the end of support threads like “I like [insert popular theme] but I want it to use blue Helvetica instead of that ugly font”. Less noise, more happiness : what are we waiting for?

2005 09 09

your search for “valid search engine” yielded one result

Amazing that MSN search is the only search engine that validates.

2005 08 25

serverside CSS makes baby Jesus cry

Now, I’m not the happiest webdeveloper when I have to use CSS hacks to achieve crossbrowser compability, but really, this is definitely not the way to get rid of such hacks (via), for all the reasons outlined in the comments on Stylegala’s similar piece “No More CSS Hacks”.

Browser Detection (yuck) + Dynamic Stylesheet (eek) = Headache-Inducing Waste Of Time / Effort / Money.

As a user, if I’ve had to change my browser’s UserAgent string to get into some bad (likely IE-only) website earlier in my browsing session, the last thing I want to see on the next website is a stylesheet being served as if I was really using the faked browser’s rendering engine. And as a webskivvy, what I’d really hate to maintain is a mess of serverside if/else/switch statements and string manipulations when all I want to do is change a colour or the position of some box.

…For Tim’s sake, dudes (an “Architect for MSN Web Experience” and the founder of Stylegala, of all guys!), haven’t the dark days of JavaScript browser detection taught you about checking for capabilities instead of UA strings? Is nostalgia for the 90’s taking over your sanity?

2005 08 05

les diptères un quatre août

Si les feuilles de styles n’ont plus beaucoup de secrets pour vous mais que vous faites un blocage sur les aspects un tantinet avancés (voire à base de pénétration anale de Musca Domestica), pas de panique !
Laurent Denis vient de pondre coup sur coup deux articles de référence, et paf la lumière fute :

Confession express: au début, j’allais toujours chercher une page au hasard pour retrouver un <link> tout prêt pour inclure une feuille de style. Je savais presque tout de ce que je sais maintenant, mais je n’avais toujours pas pris une seconde pour voir comment marchait un bête <link rel="stylesheet">. Ah, si j’avais pu lire des articles aussi démystificateurs à l’époque…

2005 06 23

U turns

Because only idiots never change their mind :

2005 05 19

that which is nice and dandy

Fake del.icio.us links until I get off my lazy arse and start using del.icio.us (I’ll blame the lack of good Gnome-ish clients too).

Addendum to the third item: wouldn’t it be nice if there was a Firefox extension that would check the generator for a site’s feed and then allow you to add the site as a search engine if the generator is WordPress or any other tool with an easily discoverable search facility?

2004 12 08

ma feuille de style va très bien, merci

Puhleeze stop e-mailing/telling me that there’s a problem with my stylesheet. There just is no stylesheet here anymore for the time being.
The reason is quite absurd: weeks ago I promised I would get back to blogging once I’d redesign this blog, so when I blogged again and the blog still had the same face, it felt like a broken promise. So there’s no stylesheet anymore until I actually get the time and inspiration to write a new one.

In other news, I’m just back from a mini-conference about blogs and journalism organised by Six Apart.
I feared it would be a “buy some Typepad” fest geared towards journalists who don’t know better, but it turned out alright. Nothing ground-breaking for the few veteran bloggers in the room, but a fine way to show journalists that they needn’t fear The Blog (they will be eventually assimilated anyway).
Heck, it even turned out bloggable. Or at least the conversations we had around drinks after the talks, did.

2004 08 10

gzipping CSS

When there’s more than one way to do it, for the love of Pete, don’t use the worst way to compress your CSS files (using PHP).

Using PHP’s ob_gzhandler will indeed compress your stylesheet.
But let’s look at the costs first:

  • CPU cost: PHP will have to parse a file where it only needs to execute one or two functions.
  • Browser/proxy cache cost: PHP won’t send the right HTTP headers by default, so the file will never get cached right. Traffic costs will actually rise unless your visitors only visit one or two pages on your website.
  • Valuable time cost: do you really want to add these lines of PHP to each and every CSS file you serve?

Horrific, isn’t it?
Instead, here’s a solution that only takes one line in your .htaccess, and mod_gzip:

mod_gzip_item_include	file	\.css$

There, instant compression on all your .css files.
This may sound like the obvious solution, but still too many are using PHP for this task because they didn’t know better, so I felt I had to blog it…

2004 08 09

printing acronyms

While trying to fit a giant title into a two lines area, converting what could be converted to acronyms, I wondered how I could expand said acronyms in the printed version of the page.
I also wondered why Gecko bothered to print a dotted border-bottom on acronyms: after all, on a sheet of paper they aren’t quite hoverable, so the dotted line is just distracting.

So anyway, here’s what one could use to print an acronym:

acronym[title]:after {
	content: "\0000a0(" attr(title) ")";
acronym {
	border-bottom: 0;

Problem: Typography dictates that only the first instance of an acronym be expanded. To comply, one would have to change acronym[title] to acronym.first[title], and then add class=”first” to the first instance of the acronym.
Half-assed workaround: CSS3 provides a :first-of-type pseudo class that applies to sibling tags. Once it’s implemented in browsers, it could be used to expand the first acronym in each container. That’s a good enough solution if one doesn’t want to pollute markup with extra classes.

2004 08 04

aujourd’hui, je ne congratulerai pas…

  • le Safari d’OSX 10.2, qui ne supporte pas les CSS d’impressions — j’ai eu l’air bien bête quand on m’a montré ce que donnait les pages du projet en cours à l’impression;
  • le label AccessiWeb, qui pense que seules les polices sans sérif sont accessibles, et que le tag <b> n’existe plus dans la dernière version d’HTML; pour me venger je ferai un jour un site très accessible en Times New Roman avec des morceaux de <b> dedans.

Ce genre de liste étant appelé à se renouveler dans les prochaines semaines, attendez vous à voir une rubrique dédiée…