W3C home > Mailing lists > Public > www-style@w3.org > May 2005

Suggestion: Inheritance

From: Hans Meiser <brille1@hotmail.com>
Date: Tue, 10 May 2005 18:14:04 +0000
Message-ID: <BAY107-F25C6F6A0B396CA9A6EF384E21F0@phx.gbl>
To: www-style@w3.org

----

Hi,

when I'm programming style sheets for a whole web application I'm missing a 
CSS feature to be able to reference CSS properties of other elements.


Let's say there is a background/foreground colour combination of:

    BasicStyles.css:
    ----------------
    body
    {
     background-color: white;
     color: red;
    }


I suggest to add a feature to CSS be able to reference these values in 
another style sheet, e.g. to be able to invert the basic colours without 
actually being required to *know* the explicit colour values. For instance:

    ParticularStyles.css:
    ----------------
    .emphasize
    {
     background-color: red;
     color: white;
    }


should become something like:

    ParticularStyles.css:
    ----------------
    .emphasize
    {
     background-color: body.color;  -- using the computed colour of the body 
element
     color: inherited.background-color;  using the computed inherited 
background-colour
    }


The requested feature doesn't necessarily require a parent style sheet or 
prior CSS declarations of any kind as it refers to computed values.

Axel Dahmen
Received on Wednesday, 11 May 2005 02:55:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:37 GMT