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 29

obligatory french post on web 2.0

Le web 2.0, c’est tellement has-been.

Les gens qui prennent au sérieux ce post pour le comptabiliser dans la liste des « méchants qui crachent dans la soupe des gentils vendeurs de buzzwords » sont priés d’acheter un sens de l’humour, surtout si c’est pour commenter du style “oh noes!1, encore une guerre de guiques dans la blaughosfaire”. Ou d’aller se tirer une balle (rayez la mention inutile).

(Addenda : vintage version numbering porn!)

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 02


When the framework that powers your blog produces horrid name and id attributes such as those for a simple search box…
funky markup on IEBlog
…you know it’s time to slap a few developers back to reason.

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 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…

2004 05 08

attack of the strange little squares

You’ve got a blog encoded in UTF8, you’re very happy with it, thanks to it your wife has a shiny coat and your dog makes love to you like never before.
Everything falls apart the day you receive a trackback from a blog encoded in ISO8859-15. Suddenly strange little squares (‘unknown character’) are disfiguring your page, the W3C says your blog is invalid trash, your readers are doubting you.

Just when the thought of blog-suicide rears its ugly head, you remember your blog is powered by WordPress, which has a très geek filters function!
The solution (after a look at the documentation) comes naturally: <?php add_filter('comment_text', 'utf8_encode'); ?>

There, now you can receive trackbacks from anyone without worrying whether they were sent in UTF8 or not!

2004 03 09

Sun, RSS, and my cock

Sun adopts RSS, seems to tout it as something so revolutionnary that it makes Microsoft uneasy.
If this wasn’t enough to provoke snickering, there’s the gem: “It may be that RSS is sufficiently standardized that we can have a diversity of clients available to read it”. I don’t know if there being nine incompatible versions of RSS makes it so sufficiently standardised. Heck, my cock is probably more standardised than RSS.

2004 02 17

charsets & weblogs

As Joi Ito talks about the emerging Iranian blogging scene (encoding Farsi as utf-8), and just as Olivier Meunier talks about adding utf-8 support to DotClear, one may wonder “What about WordPress?”

Up to this day, WordPress continuated the b2 way of using iso-8859-1 as default. You could set a $admin_area_charset variable to ‘utf-8’ or whatever charset you wanted, but you still had to hardcode your preferred charset in the default template (and the comments popup’s) and in the login/register area.
No more hardcoding. Yesterday support for choosing your charset has been added to WordPress’s incoming 1.1 release, so now it’s only a matter of going straight to the General Options screen.

( I’d like to take this occasion to congratulate the WP team for their options handling. While I thought it was overkill, it’s actually very well thought: adding this option was only a matter of adding a row to the ‘wp_options’ table in the database, and editing files to make them use $blog_charset instead of iso-8859-1. The options backend takes care of validating the input too, so no more “let’s make sure they entered a string of that max length” or “let’s make sure it’s a number and not a string”, since you defined these in the row you added to the options table. )

2004 01 06

subliminal advertising

Spotted at Znarf’s, this advertisement for FrontPage 2003 tells us they got rid of bloat code. Ain’t it nice?
Now look closely and you’ll see javascript functions names starting with ‘MM_’, just like those you can get when authoring a page with …DreamWeaver. Gotta love the subliminal attack on their competitors!