W3C home > Mailing lists > Public > www-style@w3.org > September 2001

Color prototypes

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Sat, 15 Sep 2001 19:37:22 +0200
To: www-style@w3.org
Cc: tantekc@microsoft.com
Message-ID: <hb47qt4346avs8vdcjr27c620ki1pmceod@4ax.com>

   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

  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.


  @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.

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

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