-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Polymer 1.0: element scoped CSS via <link> leaks outside the element (not truly scoped) #2367
Comments
Including a stylesheet for an element definition via Polymer does support a couple different wants to use style data separated from an element's dom-module. See https://www.polymer-project.org/1.0/docs/devguide/styling.html#external-stylesheets which will soon be updated with this info: #2229 |
Hmmm; interesting. Will it be supported at some time? If not, I suppose I could pay a small overhead cost by wrapping my CSS in some boilerplate to keep it separate from my element's markup -- essentially, I'll make a second CSS-only element next to the main one. |
No, there are no plans to directly support Because of Polymer shims style data, it needs access to style text. Unfortunately, this is not possible using |
I put the
picture-frame
element, from [1], in a Chrome extension; I included theindex.html
. After moving the script to an external file to bypass CSP issues [2], it worked fine. Next, I openedindex.html
and wrapped the content in adiv
. Then, I went back to thepicture-frame
element and moved the CSS into a separate file, naturally replacing thestyle
element with alink
element.The style rules suddenly started to apply, incorrectly, to the
div
fromindex.html
. I tried moving the style after thetemplate
element, as per a suggestion from Polymer 0.5 [3], but there was no change. The styles should apply only to the element defining them, whether they are delivered viastyle
orlink href
.[1] https://www.polymer-project.org/1.0/docs/start/quick-tour.html#compose-with-local-dom
[2] https://code.google.com/p/chromium/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Cr%20Status%20Owner%20Summary%20OS%20Modified&groupby=&sort=&id=393307
[3] #779
The text was updated successfully, but these errors were encountered: