Skip to main content

Theming

OpenCDMP provides customizable themes for each tenant in the application, based on Material 3 theming options. You can access these options through the tenant configuration.
There are 2 user input variables in order to customize a theme: primary color and css overrides.

Primary Color

Primary color is the base with which Material generates the theme that will be applied throughout the application. Note that while the primary color is used to generate the theme, it will not necessarily be the designated main color in the generated theme. The M3 theme builder will set the primary color to be as close to the user's choice as possible, without compromising on the theme contrast rules. To ensure that any one specific color is used in the theme as is, it needs to be added as a rule in the CSS overrides area.

CSS Overrides

CSS Overrides can be added in JSON format. The accepted variables are based on Material theme variables, with a few additions specific to this application.
CSS overrides are meant to replace certain system variables that are set in place when a material theme is applied.

Color values

Color values can be set using the material --md-sys-<token> naming convention. Some commonly used color tokens are the following:

NameDescription
--md-sys-surfacethe background color on most surfaces throughout the app, like cards and dialogs.
--md-sys-on-surfaceused for icons, text, and other visual elements placed on a surface background.
--md-sys-backgroundbackground color of the main area, behind any other element that the user interacts with.
--md-sys-on-backgroundused for icons, text, and other visual elements placed on the background.
--md-sys-primaryThe most common color used by components to participate in the application theme. Also the color associated with Plans.
--md-sys-on-primaryused for icons, text, and other visual elements placed on a primary background
--md-sys-tertiaryThe accent color used by components to participate in the application theme. Also the color associated with Descriptions.
--md-sys-on-tertiaryused for icons, text, and other visual elements placed on a tertiary background.

Typography values

Similarly to color, typography values can be set using the --md-sys-<scale>-<size>-<property> naming convention.

NameAvailable values
scaledisplay, headline, title, body, label
sizelarge, medium, small
propertysize, line-height, weight

Some examples of typography size value uses in the application:

NameCommon uses
--sys-body-large-sizeEditor input fields
--sys-body-medium-sizeThe base text size for the application
--sys-body-small-sizeHints, tooltips, sidebar menu footer
--sys-label-large-sizeButtons
--sys-headline-large-sizeDialog and other main titles
--sys-headline-medium-sizeSecondary titles
--sys-headline-small-sizeSidebar menu items, section titles

For more information, take a look at the list of color tokens and typography tokens.

OpenCDMP color variables

This is a list of the system variables created for OpenCDMP. They are a set of color and typography variables that can be overriden the same way as Material variables.

NameDefault valueDescription
--link-color#1E59B1The color used on all links in the application

Extra resources

For ease of use, the Material Theme Builder can be used to generate the desired color values.
Note that currently, OpenCDMP themes are generated in light mode.