The first thing that comes to my mind when I see things like this is: is CSS really that hard? I don't say that in a condescending way, but does it really need to run through a PHP (or C) processor, adding unnecessary overhead? I think it is good for some systems to output the CSS based on variables in their backend CMS or storage system, but it should be cached as to not require parsing with each request. In this instance, the CSS doesn't change based on variables coming from a backend system, it only changes based on the browser requesting it.

I can slightly understand the need for @variables inside of CSS, but I just don't get the point of adding a middleman parser to do things like this. Am I interpreting it wrong?

3 Comments Add your comment

  1. Bridget Stewart August 13th, 2008

    I looked over the Conditional CSS site. I think the idea is useful, but am sad to say that we even need something to target specific browsers for anything at all.

    I personally ran into a difference in the way FF2 and FF3 displayed something I had marked up and couldn't find what was causing the issue for the life of me. Being able to target FF2 with one tiny change in the declaration would allow me to fix the display -- but FF doesn't have conditional comments (or something similar) like IE.

    Ideally, I don't want to have to fix displays for each and every browser. I can also see how hazardous it would be to have browsers each doing their own thing and having to have different style rules for each browser and each version. In Utopia, one set of rules would work across the board. But, that's not what we are facing today.

    No, I don't think CSS is that hard. In fact, I love CSS. I just wish I could rely on each and every browser to behave the same so that I could predict the outcome of the results.

    I don't really know how this issue gets resolved, but Conditional CSS seems to fill a gap for the time being. Naturally, I won't pretend to know if it is the cleanest possible stop-gap, but so far it's the only one I've seen making an attempt to help us fix rendering quirks as easily as possible.

  2. Jonathan Christopher August 14th, 2008

    To me, CSS variables would be a welcome addition if for nothing more than instant gratification in color consistency as opposed to having to copy and paste from a color guide. Continuing, I cant see the benefit to Conditional CSS. I think it helps encourage a 'quick fix' with a conditional parser instead of really trying to find the real cause of your problem. That's not to say it's easily fixed when testing for IE (that's what conditional comments are for), I'm specifically talking about standards compliant browser rendering issues. I don't see the implementation of a CSS conditional parser as a best-case solution. On top of that, you're adding another level of maintenance.

  3. Nate Klaiber August 14th, 2008

    I understand some of the usefulness behind it, and I completely understand having the ability for consistency with colors and such in a CSS document. That all makes good sense. I just feel like CSS is trying to be over-complicated in many ways. No offense, but designers trying to think like programmers, and they come up with this. I say that in the nicest way possible.

    I also have no problem with generating CSS based on backend variables, but, I do have problems when it is implemented poorly. Ideally you can just get a cached version of the necessary stylesheets. It writes to an actual CSS file, not needing a middle layer that parses on each and every request - just for the CSS display. Even with Conditional-CSS - which is dependent on different browsers/platforms, could create cached CSS files based on the different engines, and serve them up accordingly - without having to parse an entire file. It would be kind of like fragment caching the CSS file.

    Overall, I just don't think it is thought out very well. Obviously, that is my personal opinion. I don't argue the need in some cases, I just argue the way they go about using the tools to solve the perceived problems. To me, it's more of an example of 'ooh, this is cool, I can do this with PHP' - without taking it an extra step and really thinking through the problem and the tools at your disposal.

Leave a comment

Basic HTML is allowed (a href, strong, em, blockquote).