Blog This!   Lee Geistlinger's Web Log
Blog Home
Blog Archives
LittleGhost Home

E-mail: geistlinger AT gmail.com

Loading
Pic 'O the Day
Top 10 Lists
Everyone loves lists
Reviews
Books, Movies and so on
Blogroll
Feed Me!

XML Feed

Feeds I Read

My Online Aggregator

Theme
• Default
• Spring
• Summer
• Autumn
• Winter
• Black & White
• Gray & White
• MT-ish
• Classic
Listening To...
Evidence of Efforts

This page is powered by Blogger. Isn't yours?

Valid CSS!

[Valid RSS]

Recent Posts
 Thursday, September 04, 2003
CSS Thoughts

There has been a lot of buzz about CSS lately, especially on blogs. RSS is the main subject these days, but CSS gets a fair amount of play, as well.

Interestingly, I don't think I've ever read an article that said "Don't use CSS" or "As supported today, CSS sucks" or whatever. That just occurred to me. Interesting...

Anyway.

I like CSS. I thinks it's powerful; I know it's the future (like it or not).

I also find it frustrating and limiting.

The frustrating part is familiar to anyone who has used styles, but I should explain "limiting": By this I mean the things that CSS just can't do - that it is not designed to do, and no matter your hacking, it won't work.

An example of a limit would be that the code itself (a style sheet, say), cannot do browser detection. The server/scripting language (usually JS) does this. Something has to do it in many cases, in any case, as different CSS files are sometimes served up for different browsers/platforms. Not the end of the world; CSS is not supposed to be a proceduaral language - it's just a formating sheet. (Note: I would not want CSS to support this type of programming. Why? Doesn't belong there. I just use this as an example that is pretty clear.)

OK.

That said, I do miss variables in CSS files.

I really, really miss them.

For example, how many times have you built a style sheet using, say "#cc3366" as your "red" color. So it's scattered all over the style sheet. Then the designer decides for a more pure red, so you change #cc3366 to #ff0000 all over the place.

No biggie, but let's take this a step further: You're building a portal type product, where users can customize the look and feel (i.e. the style sheet) to a degree. Suddenly, you're changing the red, the bold blue, the green footer links and so on all over the place.

And how do you do this?



None are terribly good solutions (admittedly, a portal-type site is not a normal site).

I see a "metaCSS" file that contains variables that are used as defaults (where no overrides exist) in the given CSS file. A file might look like:


<metaStyle>
font-family: arial, helvetica;
$red: #ff0000;
$green: #99cc99;
font-size: 13px;
</metaStyle>


Or whatever - but these would essentially do two things:


Yes, you can pretty much do this now - with the third portal example (above) - but it requires parsing and including on each page. And one of the nice things about CSS is that is only loads once per session (unless changed); the parse-per-page ruins this gain.

I see a need for this coming, especially with XML on the ascent: XML is pickier, validation is an issue. By putting all the variables in one place, you can guarantee that each class/id will have a default font family etc...

But that's a pipe dream (or is it?....)

First, let's get CSS supported and working so positioning actually works well and consistently.

And that's all I have to say about that...

- Posted by Lee at 2:59 PM Permalink #
^Top | Top Ten Home | Blog This! Home | Blog This! Archives