Re: [selectors4][css-syntax] Pseudo-elements vs. combinators

On Feb 5, 2014, at 3:52 PM, François REMY <francois.remy.dev@outlook.com> wrote:

> My current thought on this would be "->" or "=>", because the combinator is a concept similar to mapping an element to a set of elements (if you read from left to right, like web authors do):
> 
>   #some-element -> shadow-tree -> .some-elements { ... }
>   #some-element -> shadow-full-tree -> .some-elements { ... }
> 
> if we want to retroactively express current combinators:
> 
>   #some-element -> descendants -> .some-elements { ... } // ( )
>   #some-element -> children -> .some-elements { ... } // (>)
>   #some-element -> next-sibling -> .some-elements { ... } // (+)
>   #some-element -> next-siblings -> .some-elements { ... } // (~)
> 
> Best regards,
> François
> 
> 
> 
> ________________________________________________________
> [off-topic-post-scriptum]
> 
> because some of us like being crazy, we could even allow the reverse combinator syntax like in
> 
>   .some-elements {
>       color: blue;
>       & <- next-sibling <- .some-other-elements {
>           color: red;
>       }
>       & -> next-sibling -> .some-different-elements {
>           color: green;
>       }
>   }
> 
> aka
> 
>   .some-elements { color: blue }
>   .some-other-elements + .some-elements { color: red }
>   .some-elements + .some-different-elements { color: green } 

This looks more like two -> combinators with a token in between. I think it looks kind of nice in simple cases but the two arrow and extra spaces add 6 additional characters to each combinator name, which gets old once you nest; and once you start nesting you could get something like:

  	article -> shadow -> heading -> descendants -> p…

Where it’s getting a bit harder to spot the combinator names from the element names vs. 

	article ^shadow heading ^descendants p

…which is admittedly more compact and effectively disambiguates combinators from the things they apply to fairly well.

Received on Thursday, 6 February 2014 00:16:21 UTC