Skip to content
This repository was archived by the owner on Jun 8, 2026. It is now read-only.

Commit 557f56e

Browse files
authored
Merge pull request #6488 from IgniteUI/apetrov/chat-styling-article
docs(chat): update chat styling article
2 parents 3b352ac + 3fa0bd2 commit 557f56e

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

en/components/chat.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,37 @@ We highly recommend using the standard Web Component styling approaches before r
399399
- `<link>` elements – For larger stylesheets, inject them inside the Shadow DOM.
400400
- Inline `<style>` tags – For small, scoped style overrides.
401401

402+
### Chat theme
403+
404+
Apart from the **CSS parts** and **slots**, the Chat component also has a [`chat-theme`]({environment:sassApiUrl}/themes#function-chat-theme) function exposed by our theming engine.
405+
406+
In order to style the Chat component using the theme function, first we need to import the theming module, where all the theme functions and component mixins live:
407+
408+
```scss
409+
@use "igniteui-angular/theming" as *;
410+
411+
// IMPORTANT: Prior to Ignite UI for Angular version 13 use:
412+
// @import '~igniteui-angular/lib/core/styles/themes/index';
413+
```
414+
415+
Then, we create a new theme that extends the [`chat-theme`]({environment:sassApiUrl}/themes#function-chat-theme) and provide the `$header-background`, `$sent-message-background` and `$received-message-background` parameters. Based on these parameter values, the `$header-color`, `$sent-message-color` and `$received-message-color` are automatically set to black or white, depending on which provides better contrast with the background.
416+
417+
```scss
418+
$custom-chat-theme: chat-theme(
419+
$header-background: #4a4a4a,
420+
$sent-message-background: #fb8500,
421+
$received-message-background: #e2d8c9
422+
);
423+
```
424+
425+
Finally, **include** the custom theme in your application:
426+
427+
```scss
428+
:host {
429+
@include tokens($custom-chat-theme);
430+
}
431+
```
432+
402433
<code-view style="height:900px"
403434
data-demos-base-url="{environment:demosBaseUrl}"
404435
iframe-src="{environment:demosBaseUrl}/interactions/chat-styling-sample/" alt="Angular Chat Styling">
@@ -412,6 +443,7 @@ We highly recommend using the standard Web Component styling approaches before r
412443
- [`IgxChatMessageContextDirective`]({environment:angularApiUrl}/classes/igxchatmessagecontextdirective.html)
413444
- [`IgxChatInputContextDirective`]({environment:angularApiUrl}/classes/igxchatinputcontextdirective.html)
414445
- [`IgxChatAttachmentContextDirective`]({environment:angularApiUrl}/classes/igxchatattachmentcontextdirective.html)
446+
- [`chat-theme`]({environment:sassApiUrl}/themes#function-chat-theme)
415447
- [`Styling & Themes`](./themes/index.md)
416448

417449
## Additional Resources

0 commit comments

Comments
 (0)