W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2012

Re: Feedback and questions on shadow DOM and web components

From: Angelina Fabbro <angelinafabbro@gmail.com>
Date: Tue, 13 Nov 2012 16:23:21 -0800
Message-ID: <CAG57-HP+gFiKUurNE-x7+eLru=9WSp0JYn70Bqo=AxxbGuA54w@mail.gmail.com>
To: public-webapps@w3.org
Angelina here again -

Good to know I can style the shadow DOM hosts this way. Good for styling
elements that are specifically affected by the shadow DOM magic. I can see
that being important. So:

            <style>
                @host {
                    *[is="news"] {
                        background: #ff0; // works
                    }

                    ul {
                        border: 1px solid blue; //works
                    }


                   ul a{ color: red; } // doesn't work: doesn't style
anchors found in shadow root children
                }

                ul a{
                    color: green; // works: styles anchor in shadow list
element
                }
            </style>


It bothers me that I can't style the host children, only the host. I
definitely want to be able to do this from within the shadow DOM context.
To me, I see myself using <content select="derp"></content> to pull in the
host's children by some criteria and then style them to my widget's
context. This only seems to let me select the host itself, whereas I had
interpreted it to be a rule that would let me declare styles for shadow
host children in the scope of a particular shadow/component.
Received on Wednesday, 14 November 2012 00:24:08 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:56 GMT