Re: Suggestion: Inheritance

Hans Meiser wrote:
>     .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.

It's not that easy. What colors should the following result to?

p { color: span.color; }
.special+p {color: blue; }
span { color: p.color; }

In addition to that, which selector syntax do you suggest for selecting 
which element (or rule?) should the computed value be requested from?

If you allow something like
p { color: *[has_style(display:table)].background-color; }
there's no limit for the circular references. And if you only allow ID 
for the source of the value, I think it's too limited.

I'm afraid that you're going to be told to use style sheet preprosessing 
tools...

-- 
Mikko

Received on Wednesday, 11 May 2005 05:17:04 UTC