-
Notifications
You must be signed in to change notification settings - Fork 91
Styles for dark/light theme are leaking to other components #130
Comments
Hi @centigrade-thomas-becker , Thanks for pointing this out! Will consider this enhancement for a next release! Cheers |
Hi @centigrade-thomas-becker , I haven't released this with 2.0.5 but I'm still planning to release this at some point. Cheers. |
Another solution would be to add the element name to the css rules, like |
Hi @centigrade-thomas-becker , I think that adding a selector prefix to it would be ideal (Such as Would you be comfortable in getting a PR for this? If you want to work around this just remember to do some dev testing around the default light and dark themes and also to test the custom theme support as well. Cheers |
Sorry, I am short on time right now. |
The changes discussed here were released with https://github.com/rpaschoal/ng-chat/releases/tag/3.0.1 The changes were pushed with this pull request: #156 |
Given the following example:
The
<h1>
element will inherit the styles for "dark-theme", even though it is not part of ng-chat.The ng-chat decorator uses
encapsulation: core.ViewEncapsulation.None
, so the generated styles for "dark-theme" or "light-theme" will be applied to any element of the Angular app that match the class name "dark-theme":A quick solution would be to add a custom prefix to all generated styles. If the basic class is changed to
ng-chat-dark-theme
then no other components in Angular should be affected.The text was updated successfully, but these errors were encountered: