Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

How do i implement customtheme #183

Open
keithlim opened this issue Feb 1, 2021 · 2 comments
Open

How do i implement customtheme #183

keithlim opened this issue Feb 1, 2021 · 2 comments
Labels

Comments

@keithlim
Copy link

keithlim commented Feb 1, 2021

can anyone help me in loading the custom theme for ng-chat? Im not exactly sure the proper way of inserting the css into the code, what i've done so far isnt working. Any help will be greatly appreciated!

In my app.component.html im using

<ng-chat [adapter]="adapter" [userId]="userId" [title]="title" [theme]="theme" [customTheme]="customTheme">
</ng-chat>

and in my app.component.ts im using

theme = Theme.Custom
customTheme = "./ng-chat.css"

and in my ng-chat.css im using

#ng-chat.custom-theme .primary-background {
  background-color: blue;
}
@duzenko
Copy link

duzenko commented Mar 3, 2021

@rpaschoal ?

@rpaschoal
Copy link
Owner

Hi @keithlim and @duzenko ,

Check this file as an example on the styles that can be customized: https://github.com/rpaschoal/ng-chat/blob/master/src/ng-chat/assets/themes/ng-chat.theme.dark.scss

If your custom styles are not reflecting your ng-chat.css file it could be that it is failing to load the customTheme path you are supplying. In the end it just tries to load it as an href. You can check it out here on the first line: https://github.com/rpaschoal/ng-chat/blob/master/src/ng-chat/ng-chat.component.html

The component has ViewEncapsulation set to none so even if not using a custom theme you should be able to override the styles as a last resort.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants