OneCX Theming
Overview
In an OneCX application theming is handled by the OneCX shell in collaboration with the OneCX Theme Management application.
OneCX compatible application:
-
should use theme variables to theme its content.
Theme Appliance
In OneCX each workspace can use different theme for its pages. Each theme defines a set of the same CSS variables that are available on each pages with different values. The availability of those CSS variables is handled by the OneCX shell based on the accessed workspace. It means that OneCX compatible application does not have to do anything to apply the theme. The only responsibility is to use theme variables.
Theme Variables
Theme variables are CSS variables available on the page for any application.
Below, is a list of all theme variables available on the page:
- Basic Variables
CSS variable |
Description |
|
Primary color of non-text content. |
|
Secondary color of non-text content. |
|
Default background color of non-text content. |
|
Default background color on hover of non-text content. |
- Text-related Variables
CSS variable |
Description |
|
Default font family for text content. |
|
Default font size for text content. |
|
Primary font text color. |
|
Secondary font text color for elements in lower design hierarchy, usually less prominent. |
CSS variable |
Description |
|
Background color of a button in hover state. |
|
Background color of a button in active state. |
|
Background color of a button with danger severity. |
- Message-related Variables
CSS variable |
Description |
|
Background color of a message with info severity. |
|
Background color of a message with success severity. |
|
Background color of a message with warning severity. |
|
Background color of a message with error severity. |
- Misc Variables
CSS variable |
Description |
|
Color of divider HTML elements, such as |
|
Background color of the document’s body, used for the content pane’s background color. |
|
Background color of the overlays, |
- Topbar Variables
CSS variable |
Description |
|
Background color of the topbar. |
|
Background color of the topbar’s left side. |
|
Color of the text in the topbar. |
|
Color of the text of the items located in the topbar. |
|
Background color for the items located in the topbar on hover state. |
|
Background color of the vertical menu hiding toggle. |
|
Color of the topbar’s logo. |
CSS variable |
Description |
|
Background color of the sidebar (left side of the shell). |
|
Text color of the menu, located in the sidebar (left side of the shell). |
|
Text color of the menu item, located in the sidebar (left side of the shell). |
|
Background color of the menu item, located in the sidebar (left side of the shell). |
|
Background color of the menu item in hover state, located in the sidebar (left side of the shell). |
|
Text color of the menu item in active state, located in the sidebar (left side of the shell). |
|
Background color of the menu item in active state, located in the sidebar (left side of the shell). |
Utilizing Theme Variables
When creating styles for UI components it’s important to consider whether a style should be theme-aware. Example of a stylesheet using a theme variable:
button {
background-color: var(--primary-color);
}
The example above will set background color for each button element to the value corresponding to the --primary-color
theme variable value.