Re: [css-regions] ::region() or ::fragment() pseudo-element

Good morning everybody,

> The whole reason I took Shadow DOM
> down the pseudo-element route was to keep the distribution selector
> from being a "normal selector", because it's really not - there's some
> tree-jumping going on.  But using an at-rule to break up the selectors
> accomplishes the same thing, and looks like it might indeed be easier
> from an authoring perspective, and better for nesting purposes.
>
> Okay, I guess I'm not opposed to switching back to an at-rule.
>
> ~TJ

I may be wrong, but I'm under the impression that Tab's argument in favor of 
pseudo-element usage instead of a cominator may very well fit for Shadow DOM 
but doesn't apply to the Region case. The reason I believe this is that 
there's actually a proposal in this thread to allow 
"<p>::fragment-in(#region)" which means that when we write "#region::region 
<p>", we do not break the rule that says that "<a> combinator <b>" matches a 
restricted set of elements from "<b>".

So, my proposal is still to allow normal selector operators to continue 
normally after the ::region pseudo-element. That would allow things like:

    #region::region {
        & p { ... }
        & figure { ...; & img { ... } }
    }

and

    #region::region p { ... }
    #region::region figure { ... }
    #region::region figure img { ... }

which looks like the best option to me. Sometimes the grouped approach wins 
over the repeated one and vice-versa, so having both looks good.


Yet, if for some reason that would not do the trick, the @region at-rule 
could be okay. I'm certainly not fan of a pseudo-element with parenthesis, 
whatever the order in which the region and content selector appear.





______________________________
PS: Just an idea I had now for a more beautiful style of selector grouping 
where there are more than one sub-selector: using a second bracket-paired 
group to store sub selectors. Something like:

    figure { /* root properties */ } {
        img { ... }
    }

or, if we want to keep strong nesting:

    figure {
        /* root properties */
        {
            img { ... }
        }
    }

and, if you don't need to set properties on the figure element

    figure {{
        img { ... }
    }}

but maybe I should start another thread for this. 

Received on Saturday, 15 June 2013 08:12:46 UTC