Re: Using Shadow DOM @host rule with :scope pseudo-selector

In reading [1] more closely, I see that @host rules are not matched
starting at the host element, but *specifically* to the host element.

In that sense, it does not make sense for @host to establish a context
scope, because @host { :scope { … } } is redundant at best.

Regards,

Dominic

[1] <
https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#host-at-rule
>


On Fri, Feb 1, 2013 at 12:10 PM, Dominic Cooney <dominicc@google.com> wrote:

> I wanted clarification on the meaning of @host rules [1] in combination
> with the :scope pseudo selector [2].
>
> Am I correct in assuming that if I wanted to style the host element, and
> only the host element, I could apply these features in combination this way?
>
> @host {
>   :scope {
>     border: 1px solid orange;
>   }
> }
>
> I think that is awesome.
>
> It might be clearer whether these features combine in this way if the
> Shadow DOM spec mentioned @host establishing the "contextual reference
> element set" mentioned in the CSS 4 Selectors spec.
>
> Regards,
>
> Dominic
>
> [1] <
> https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#host-at-rule
> >
> [2] <http://dev.w3.org/csswg/selectors4/#scope-pseudo>
>
>
>
> --
> <http://goto.google.com/dc-email-sla>
>



-- 
Email SLA <http://goto.google.com/dc-email-sla> •
Google+<https://plus.sandbox.google.com/111762620242974506845/posts>

Received on Friday, 1 February 2013 03:38:41 UTC