W3C home > Mailing lists > Public > www-style@w3.org > June 2013

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

From: François REMY <francois.remy.dev@outlook.com>
Date: Sat, 15 Jun 2013 10:12:26 +0200
Message-ID: <DUB120-DS17D6B1C9ECAAEE429E3FA3A5810@phx.gbl>
To: "Tab Atkins Jr." <jackalmage@gmail.com>, "Brad Kemper" <brad.kemper@gmail.com>
Cc: "Alan Stearns" <stearns@adobe.com>, "W3C WWW Style" <www-style@w3.org>
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 { ... } }


    #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

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:31 UTC