-
Notifications
You must be signed in to change notification settings - Fork 3
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
create intermediate shadowRoot to scope styles #6
base: master
Are you sure you want to change the base?
Conversation
17ae5a8
to
7daf498
Compare
webcomponents/shadydom#130 got fixed in |
b21052e
to
07b8161
Compare
After discussing about this offline with @frankiefu, I opted for always creating the intermediate shadowRoot and scope styles. There is no strong case for having the content stamped on the light dom, so better not to implement that feature until there is one. |
iron-overlay/iron-overlay-container.html Line 160 in facfb1b
getRootNode ?
iron-overlay/iron-overlay-renderer.html Line 176 in facfb1b
classList.toggle 's second argument is not supported in IE 11.
|
@frankiefu thanks for the review, fixed! |
Heya, going through old PRs thanks to Project Health. What is the status of this PR? Do I still need to be assigned? |
@cdata yeah I'd like to know WDYT of this approach for scoping styles. The user will declare the overlay like this: <iron-overlay id="myOverlay">
<template>
<style> div { background: orange } </style>
<div>hello world</div>
</template>
</iron-overlay> Which will result in a stamped renderer with content scoped into a new shadowRoot: <iron-overlay-renderer data-overlay="myOverlay">
<iron-overlay-content-host>
#shadowRoot
<style> div { background: orange } </style>
<div>hello world</div>
#/shadowRoot
</iron-overlay-content-host>
</iron-overlay-renderer> Pros: styles are scoped |
Speaking abstractly, I like it. I don't consider the con you mentioned to be a big deal. |
Fixes #2
If we find awe scope it by creating an intermediate element and host content in its shadowRoot.<style>
in the content template,Added new property
contentHost
to allow querySelectors & adding event listeners on the right host.Tests failing because of webcomponents/shadydom#130