This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > April 2006 > Defining CSS style references/shortcuts/aliases





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Defining CSS style references/shortcuts/aliases
Nedron

2006-04-13, 10:52 pm

Is there any mechanism within CSS to create a named alias and then use
that alias in later CSS directives?

Basically, something like #DEFINE in C.

I'd like to do something like...

color-foo.css
=========
define Color1 #FF00EE;
define Color1 #FFAAFF;

color-bar.css
=========
define Color1 #AA55CC;
define Color1 #AAAAFF;

test.css
======
@import url("color-foo.css");
h1 { color: Color1; }
h2 { color: Color2; }

I'd like to do this so that I can change my color palette by simply
changing the import in test.css.

Any ideas?

-David

David Dorward

2006-04-14, 6:44 am

Nedron wrote:

> Is there any mechanism within CSS to create a named alias and then use
> that alias in later CSS directives?


No, but you can use a preprocessor to convert your "CSS with some aliases in
it" file to regular CSS.

http://www.cs.tut.fi/~jkorpela/html/cpre.html for example.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews