CSS entities?

Something I have missed when designing a tree of style sheets is some kind
of parameter mechanism, maybe something similar to SGML entities (like
%length; and %flow; and all those). It would be particularily useful when
it comes to colour, where there are several interdependent values (as a
minimum foreground, background and border), but also for type and probably
aural style sheets. Single values could rely on the cascade.

What I had in mind was something like this

/* colour scheme */
%fg-colour [#330]; 
%bg-colour [#FFC];
%border-colour [#000];
%identity-colour [#ABC];
%warning [#F20];
/* end colour scheme */


Referred to like this

div.box {color: &fg-colour&; background-color: &bg-color&; border:
&border-colour& medium}
div.alternate-box {/* some different scheme */}


Properties referring to undefined entities are ignored (as would CSS2
parsers), if the same entity is defined several times, the closest will be
chosen (using the metrics that this has precedence over that, and last has
presedence over first).

I haven't looked for the optimal syntax. The main point is that it would
make CSS maintainance and consistence easier for designers, without (I
hope) making implementation much harder for programmers. So what do you
think, is this a viable suggestion, or would it just add needless
complexity to CSS3?

Received on Saturday, 15 January 2000 06:49:43 UTC