Using your own theme
The theme property decides which layers a component gets:
-1 (ThemeOption.NONE): no theme classes at all, you style everything yourself.
0 (ThemeOption.BASE): only .theme, so the structure without the default colors.
1 (ThemeOption.DEFAULT): .theme.theme-default, structure and default theme.
To write your own theme from scratch, keep the structure, drop the default theme and give the
component a class name of your own with themeName:
<cui-grid id="orderGrid" ui-theme="0" ui-theme-name="my-theme"></cui-grid>
.grid.theme.my-theme
{
/* your colors, borders and shadows */
}
The theme variables stay available with ui-theme="0", so your own rules can still
use var(--cui-color-primary) and the rest. The default colors just aren't applied,
because those rules only match .theme-default.
To keep the default theme and only add a few rules of your own on top, leave the theme at
1 and add your theme name:
<cui-grid id="orderGrid" ui-theme="1" ui-theme-name="my-tweaks"></cui-grid>
To use your theme name on every component, set it once with
componyx.UI.themeName = 'my-theme'; before the components render. In most cases
overriding the tokens is enough though, and a lot less work than a full theme.