-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Sibling components next to ViewEncapsulation.Native mode component are getting their styles put in Shadow DOM #7887
Comments
still an issue with Angular 2.0.1 |
…on in shadow DOM Closes angular#7887
…on in shadow DOM Closes angular#7887
…on in shadow DOM Closes angular#7887
…on in shadow DOM Closes angular#7887
The fix in the PR is actually wrong and breaks the styling of components with emulated / no encapsulation inside of components that use native encapsulation. Our strategy is as follows: I.e. we are waiting for a browser feature that allows to style elements inside of shadow roots via a |
…w dom inside of components that do. This reverts 53cf2ec and adds a test for this case. Related to angular#7887
…w dom inside of components that do. This reverts 53cf2ec and adds a test for this case. Related to angular#7887
Allow to style components that don’t use shadow dom inside of components that do. This reverts 53cf2ec and adds a test for this case. Related to angular#7887
Allow to style components that don’t use shadow dom inside of components that do. This reverts 53cf2ec and adds a test for this case. Related to angular#7887
Allow to style components that don’t use shadow dom inside of components that do. This reverts 53cf2ec and adds a test for this case. Related to angular#7887
Allow to style components that don’t use shadow dom inside of components that do. This reverts 53cf2ec and adds a test for this case. Related to angular#7887
Can this also be reverted in the next 2.x Version? |
yeah, it must be reverted in 2.x @tbosch |
…on in shadow DOM (angular#14313) Closes angular#7887 PR Close angular#14313
Allow to style components that don’t use shadow dom inside of components that do. This reverts 53cf2ec and adds a test for this case. Related to angular#7887
…on in shadow DOM (angular#14313) Closes angular#7887 PR Close angular#14313
Allow to style components that don’t use shadow dom inside of components that do. This reverts 53cf2ec and adds a test for this case. Related to angular#7887
I can confirm this is still the behaviour with angular 6. The shadow dom of a native encapsulated component receives multiple style elements with the css rules from other components. |
Duplicate of #5059 5059 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Steps to reproduce and a minimal demo of the problem
styles
orstyleUrls
component metadata property.encapsulation
component metadata property toViewEncapsulation.Native
ViewEncapsulation.Native
mode.ViewEncapsulation.Native
mode.ViewEncapsulation.Native
:head
tag as expected:Here is an example on Plunker
Current behavior
![image](https://cloud.githubusercontent.com/assets/1243236/14228051/7a0a9690-f8bf-11e5-84b5-9c2982c75981.png)
Looks like the CSS shim that is getting created into a
<style>
tag is getting inserted into sibling components in the component tree that are inViewEncapsulation.Native
mode. It also looks like they are put in there in the same order that the custom elements are found within the parent component template markup. So if two non-native mode sibling components are processed in the DOM tree before the native mode one, their<style>
tags will come before the native one and the native one's markup in the shadow DOM:Expected/desired behavior
I believe that this is not the desired behavior and that those other sibling component styles should not be ending up in the Shadow DOM of the native mode component.
The text was updated successfully, but these errors were encountered: