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

On 07/04/2016 12:58 AM, Hr Gwea wrote:
> Ok, that reduces the duplication a bit, but still requires elem1 and elem2 to be named explicitly twice. Which is not 
> convenient when elem1 and elem2 are complex selectors.
> 
> I was thinking of the possibility to pass parameters to the descendant combinator.
> For example:
> 
> elem1 >(3)> elem2  /*descendants up to third level*/
> elem1 >(2,5)> elem2  /*descendants from second to fifth level*/
> elem1 >(1)> elem2  /*same as child combinator*/
> 
> How do you like it?

It's not an unreasonable proposal, but, unless it was a very common
case, I don't think it would be worth the effort to add this to CSS
given there's a usable solution for it already.

~fantasai

Received on Monday, 1 January 2018 15:26:57 UTC