Color prototypes

Hi,

   I want to propose a method for CSS Level 3 to define and specify my
own color prototypes. It's quite common to use the same color for
various concepts in a document. CSS enables the author to group
selectors
like

  h1, h2, h3 { color: red }

but this takes only specific properties into account. If I want to use
the same color for different properties (e.g. border-color,
background-color and text-underline-color) I can't use this type of
grouping and if I want to the color only for some elements and another
color for other elements, complexity raises again. The author ends up
with specifying the same colors again and again thus editing becomes a
very hard task. I therefore propose a new at-rule to declare the
prototype. It may look like

   @color <name> <color>;

Where <name> is an ident token and <color> the current <color> token.

Example:

  @color brand rgb(22, 176, 64);

The <color> token used in the property definitions, that take some
color, should then be extended with a new color() function, e.g.

  h1 { color: color(brand);
       text-underline: single-accounting color(brand) }

If the user agent hasn't seen a @color rule for the specified name, the
property must be ignored. If there were multiple @color rules, the
color() function refers to the last definition of that color.

This would greatly ease writing and maintaining stlye sheets.

regards,
-- 
Björn Höhrmann { mailto:bjoern@hoehrmann.de } http://www.bjoernsworld.de
am Badedeich 7 } Telefon: +49(0)4667/981028 { http://bjoern.hoehrmann.de
25899 Dagebüll { PGP Pub. KeyID: 0xA4357E78 } http://www.learn.to/quote/

Received on Saturday, 15 September 2001 13:38:31 UTC