Suggestion: Inheritance

----

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 UTC