Re: [selectors] Tree selectors

Mats Palmgren wrote:

> How about something similar to counters? [1]
>   body, section, navigation { depth-weight: IDENT 1; }
>   h:depth(IDENT, 3) {}
> that is, :depth(IDENT, number) would match an element where the sum of
> its ascenders' weight for the depth IDENT equals number.

As Ian said, it's a neat idea but it adds a new dependency from
selectors to values. And that's quite a bad one IMHO:

   div:depth(divdepth, 3) { depth-weight: divdepth 1; }


Even if you solve that saying that depth-weight property cannot be used
if the :depth() functional notation is used in the selector part, you'll
still have to resolve depth-weight declarations in a first step before all
other declarations:

   div                    { depth-weight: divdepth 1; }
   div:depth(divdepth, 3) { color: red }


Received on Tuesday, 22 March 2005 08:10:22 UTC