Alex Rivera | Logout

Abstraction away from CSS

Asked 2008-08-24T23:33:25.917
14

Many frameworks seek to abstract away from HTML (custom tags, JSFs component system) in an effort to make dealing with that particular kettle of fish easier.

Is there anything you folks have used that has a similar concept applied to CSS? Something that does a bunch of cross-browser magic for you, supports like variables (why do I have to type #3c5c8d every time I want that colour), supports calculated fields (which are 'compiled' into CSS and JS), etc.

Alternatively, am I even thinking about this correctly? Am I trying to push a very square block through a very round hole?

Edit
Report

2 Answers

9

You can always use a template engine to add variables and calculated fields to your CSS files.

answered 2008-08-24T23:49:58.373
0

@SCdF: I think your summary here is fair. But the argument that some people don't have the time to learn CSS is bogus - just think about for a second. Substitute a technology that you've mastered and you'll see why:

I. Hate. Java. Is there something out there that will just write it for me? Not everyone has the time to master Java.

CSS is certainly an imperfect technology - I have high hopes that 5 years from now we won't be dealing with browser incompatibilities any more (we're almost there), and that we'll have better author-side tools (I've written a Visual Studio macro for my own use that provides the the sort of variables and calculations that you describe, so it's not impossible) - but to insist that you should be able to use this technology effectively without really understanding it just isn't reasonable.

answered 2008-10-30T13:45:08.067

Your Answer