Re: [css-selectors] descentant up to a certain depth

Brad Kemper <[email protected]> Sun, 3 Jul 2016 09:03:04 -0700
Newsgroups gmane.comp.web.css.general
Message-ID <[email protected]>
> On Jul 2, 2016, at 7:51 PM, Hr Gwea <[email protected]> wrote:
> 
> Is there any plans or ideas to simplify selectors like this:
> 
> elem1 > elem2,
> elem1 > * > elem2,
> elem1 > * > * > elem2 {...properties...}
> 
> i.e. all elem2 that are children, grandchildren or great-grandchildren of elem1.
> More generally, a descendant combinator that let us specify the max depth of the descendants

In selectors 4, :not() can take a selector list. 

elem1 elem2:not(elem1 * * * elem2) {
  /* should do what you want */
}

> If not, can I propose a solution?

You can always propose.