CometChatUIKit’s palette is a predefined set of colors to provide a consistent and unified color scheme that can be used across various elements and components. It supports 2 specific color schemes i.e. light and darkCometChatUIKit’s palette primarily consists of four colors. It includes the background color, primary color, error color, accent color, and its variations of shades and tints.
Mode
Color code
Light
#FFFFFF
Dark
#141414
Color
Description
Color code in light mode
Color code in dark mode
background
This is used as the background color for the main UI components.
#FFFFFF
#141414
primary
This is used to highlight or emphasize elements.
#3399FF
#3399FF
error
This color is used for the destructive components/actions in components across UI Kit
#FF3B30
#FF3B30
accent
This color is used as the background color to emphasize elements, but with less vibrance than the primary color
CometChatUIKit’s typography encompasses the font family, font size and other typographic elements. All fonts used in UI Kit are pre-configured with the below values, but you can also customize it.
Name
Description
Value
Font family
This accepts a prioritized list of one or more font family names and/or generic family names for the selected element
import { createApp } from "vue"; import App from "./App.vue"; const app =createApp(App); //App level provider makes the provided value available acrossthe application via inject app.provide("theme", new CometChatTheme({}));app.mount("#app");
Step2: Injecting and using the Theme within the component
App level providers to make it available in the entire application Component level providers to make it available in child components
Report incorrect code
Copy
Ask AI
<script lang="ts">import { defineComponent, inject, provide } from "vue";export default defineComponent({ setup() { //Inject the Theme in the component to be used //A default value can be provided as a fallback while injecting let injectedTheme = inject("theme", DefaultThemeObject); //using the theme let defaultStyle: CallButtonsStyle = new CallButtonsStyle({ voiceCallIconTint: injectedTheme.palette.getPrimary(), videoCallIconTint: injectedTheme.palette.getPrimary(), voiceCallIconTextColor: injectedTheme.palette.getPrimary(), videoCallIconTextColor: injectedTheme.palette.getPrimary(), }); return {}; },});</script>
Theme can also be provided within a component but this will only be available to be injected in the child components
Report incorrect code
Copy
Ask AI
<script lang="ts">import { CometChatTheme } from "uikit-resources-lerna";import { defineComponent, provide } from "vue";export default defineComponent({ setup() { //Make the theme available to child components by providing it in a parent component provide("theme", new CometChatTheme({})); return {}; },});</script>