Re: CSS syntax inside scoped style, was: Wiki page for style attribute

2007/7/3, Rene Saarsoo:
>
> Eric Daspet wrote:
> > <article>
> >   <style scoped> color: blue ; </style>
> >   <p>My external paragraph integrated in the main document</p>
> > </article>
>
> Is this really how the scoped style element should be used?

No.

> As I have understanded the draft, you should still use selectors,
> like this:
>
> > <article>
> >   <style scoped> p {color: blue;} </style>
> >   <p>My external paragraph integrated in the main document</p>
> > </article>

Yes, that's the expected use.

> While I'm on to that, I would like to ask some questions about
> how the scoped style works, because the draft doesn't make it
> clear.

My opinion is that this should be identical to what's defined in
http://www.w3.org/TR/css-style-attr [css-style-attr] (particularly,
read the last paragraph of
http://www.w3.org/TR/css-style-attr#examples)

I like this [css-style-attr] draft and if the WG prefers the <style
scoped> syntax I think the rules shouldn't be different.

[...]

> Now let's try some selectors in scoped style block.
>
> Of course the following will match all <p>-s inside article:
>
> p {}
>
> I guess all those also match the article element:
>
> article {}
> #article-1 {}

Yes

> article:first-child {}

As I understand [css-style-attr], no, because article would the root
of the "subdocument", i.e. it wouldn't be the child of any other
element (in the context of the scoped stylesheet).

> Does this also match the article?
>
> body > #articles > article {}

No (see above)

> Root element should still be html, so this should match nothing:
>
> :root {}

No, it would match the article element (see above)

-- 
Thomas Broyer

Received on Tuesday, 3 July 2007 18:11:59 UTC