W3C home > Mailing lists > Public > www-style@w3.org > January 2000

CSS entities?

From: Jonny Axelsson <jonny@metastasis.net>
Date: Sat, 15 Jan 2000 12:47:40 +0100
Message-Id: <>
To: www-style@w3.org
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

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:52 UTC