- From: Brad Kemper <brad.kemper@gmail.com>
- Date: Mon, 20 May 2013 09:09:30 -0700
- To: François REMY <francois.remy.dev@outlook.com>
- Cc: Håkon Wium Lie <howcome@opera.com>, "Tab Atkins Jr." <jackalmage@gmail.com>, Alan Stearns <stearns@adobe.com>, Sylvain Galineau <galineau@adobe.com>, "www-style@w3.org" <www-style@w3.org>
On May 20, 2013, at 7:02 AM, François REMY <francois.remy.dev@outlook.com> wrote:
>>> ::region(>strong) {
>>> abc: def;
>>> abc: def;
>>> @where :hover {
>>> abc: def;
>>> abc: def;
>>> }
>>> }
>>
>> I take this to mean '::region(>strong) :hover'. But how to do the embedding for '::region(>strong):hover' or '::region(>strong :hover)' or '::region(>strong:hover)'? The @rule didn't suffer this lack of clarity.
>
> You're right. I noted this issue before, but didn't notice it impaired nesting.
>
> So, if we want a pseudo element and justify this with nesting possibilities, we will need a pseudo-element without the parentheses (ie: a combinator-like pseudo-element), or we should use a true combinator or an at-rule instead.
>
>
> The advantage of the combinator is that you can use both the independent and grouped syntaxes:
>
> my-region ... region-content {}
> my-region ... region-content-2 {}
>
> and
>
> my-region {
> @then ... region-content {}
> @then ... region-content-2 {}
> }
>
> and
>
> my-region {
> @then {
> region-content {}
> region-content-2 {}
> }
> }
>
> while with @region you are forced to use the second alternative
>
> @region my-region {
> :scope region-content {}
> :scope region-content-2 {}
> }
>
> (note that it may be seen as an advantage by some)
I agree that the combinator approach looks and works better than the pseudo-element approach. But it seems a bit overkill to create a whole new combinator, just for use with regions only.
Also, of the examples you gave, the @region version had the best combination of compactness (once you remove the unnecessary ':scope' parts) and DRY-ness. And to my eye is the clearest.
Received on Monday, 20 May 2013 16:10:00 UTC