Variables
The Telerik and Kendo UI Material theme employs multiple variables that you can use to customize the theme.
Color Palette
As this theme follows the Material Design guidelines, it sets itself apart from the other Telerik and Kendo UI themes by implementing color palettes and the option to choose between dark and light theme variants. This helps you to customize the theme while following the Material Design guidelines. The preferred way for customizing the theme is by changing the primary, secondary, and tertiary palette and also by switching between the light and dark variants.
The following example shows how to customize the primary and secondary color palettes and make your theme dark.
// High level variables
$primary-palette-name: purple;
$secondary-palette-name: cyan;
$theme-type: dark;
// Import the theme after your customization
@import "@progress/kendo-theme-material/dist/all.scss";
If you need more flexibility and you do not insist on following the Material guidelines strictly, you can customize the theme variables in the same way as with the other Telerik and Kendo UI themes.
Variables by Scope
When it comes to the effect that a specific change in a variable's value causes, variables are not equal. Changing some values will have a much wider impact on the theme than changing others.
Depending on the extent of the styles that each variable controls, the variables fall into three main groups:
- Global variables—They control globally used theme colors like
$kendo-color-primary
,$kendo-color-secondary
,$kendo-color-success
,$kendo-color-error
. - Variables affecting all UI components—For example,
$kendo-component-text
,$kendo-component-bg
. - Variables affecting individual UI components—For example,
$kendo-grid-bg
,$kendo-tabstrip-font-size
.
Most component-level variables link to generic variables that are higher in the hierarchy. For instance, you can customize the background of the Grid component both through the $kendo-component-bg
and $kendo-grid-bg
variables. In this case, consider that the $kendo-grid-bg
variable references $kendo-component-bg
.
Here is a quick example on how to customize the Telerik and Kendo UI Material theme:
// Change primary color of the theme
$kendo-color-primary: #b5026d;
// Increase the line height
$kendo-line-height: math-div( 30, 14 );
// Import the theme after your variables customization
@import "@progress/kendo-theme-material/dist/all.scss";
// Note: the variables bellow this point will not take effect,
// because the theme is already imported
$kendo-component-border: blue;
List of Variables
The following tables represent the variables in the Telerik and Kendo UI Material theme by the type of styles that they control.
Typography Variables
The typography Sass variables set the styles related to fonts and text.
Variable | Default Value | Computed Value | Value |
---|---|---|---|
kendo-font-size | 14px | 14px | Default: 14px Computed: 14px |
Description: Base font size across all components. | |||
kendo-font-family-sans-serif | Roboto, "Helvetica Neue", sans-serif | Roboto, "Helvetica Neue", sans-serif | Default: Roboto, "Helvetica Neue", sans-serif Computed: Roboto, "Helvetica Neue", sans-serif |
Description: Font family for text. | |||
kendo-font-family-monospace | Consolas, "Ubuntu Mono", "Lucida Console", "Courier New", monospace | Consolas, "Ubuntu Mono", "Lucida Console", "Courier New", monospace | Default: Consolas, "Ubuntu Mono", "Lucida Console", "Courier New", monospace Computed: Consolas, "Ubuntu Mono", "Lucida Console", "Courier New", monospace |
Description: Font family for monospaced text. Used for styling the code. | |||
kendo-font-family | Roboto, "Helvetica Neue", sans-serif | Roboto, "Helvetica Neue", sans-serif | Default: Roboto, "Helvetica Neue", sans-serif Computed: Roboto, "Helvetica Neue", sans-serif |
Description: Font family across all components. | |||
kendo-line-height | k-math-div( 28, 14 ) | 2 | Default: k-math-div( 28, 14 ) Computed: 2 |
Description: Line height used along with $kendo-font-size. |
Common Variables
The common Sass variables control a wide range of styles that are not related to a specific UI component.
Variable | Default Value | Computed Value | Value |
---|
Component Variables
The component Sass variables are dedicated to a specific UI component and control its styles.
Variable | Default Value | Computed Value | Value |
---|---|---|---|
kendo-component-bg | k-map-get( $theme, component-bg ) | #ffffff | Default: k-map-get( $theme, component-bg ) Computed: #ffffff |
Description: Background color of a component. Note: do not use this variable directly. Instead derive it as `$component-name-bg` e.g. `$kendo-grid-bg: $kendo-component-bg !default;`. | |||
kendo-component-text | k-map-get( $theme, component-text ) | rgba(0, 0, 0, 0.87) | Default: k-map-get( $theme, component-text ) Computed: rgba(0, 0, 0, 0.87) |
Description: Text color of a component. Note: do not use this variable directly. Instead derive it as `$component-name-text` e.g. `$kendo-grid-text: $kendo-component-text !default;`. | |||
kendo-component-border | k-map-get( $theme, component-border ) | rgba(0, 0, 0, 0.12) | Default: k-map-get( $theme, component-border ) Computed: rgba(0, 0, 0, 0.12) |
Description: Border color of a component. Note: do not use this variable directly. Instead derive it as `$component-name-border` e.g. `$kendo-grid-border: $kendo-component-border !default;`. |
Color-System Variables
The color-system Sass variables control the theme styles related to color.
Variable | Default Value | Computed Value | Value |
---|---|---|---|
kendo-color-primary | material-color( $primary-palette, main ) | #3f51b5 | Default: material-color( $primary-palette, main ) Computed: #3f51b5 |
Description: The color that focuses the user attention. Used for primary buttons and for elements of primary importance across the theme. | |||
kendo-color-primary-contrast | material-color( $primary-palette, main-contrast ) | white | Default: material-color( $primary-palette, main-contrast ) Computed: white |
Description: The color used along with the primary color denoted by $kendo-color-primary. Used to provide contrast between the background and foreground colors. | |||
kendo-color-secondary | material-color( $secondary-palette, main ) | #e51a5f | Default: material-color( $secondary-palette, main ) Computed: #e51a5f |
Description: The secondary color of the theme. | |||
kendo-color-secondary-contrast | material-color( $secondary-palette, main-contrast ) | white | Default: material-color( $secondary-palette, main-contrast ) Computed: white |
Description: The color used along with the secondary color denoted by $kendo-color-secondary. Used to provide contrast between the background and foreground colors. | |||
kendo-color-tertiary | material-color($tertiary-palette, main) | #00695c | Default: material-color($tertiary-palette, main) Computed: #00695c |
Description: The tertiary color of the theme. | |||
kendo-color-tertiary-contrast | material-color($tertiary-palette, main-contrast) | white | Default: material-color($tertiary-palette, main-contrast) Computed: white |
Description: The color used along with the tertiary color denoted by $kendo-color-tertiary. Used to provide contrast between the background and foreground colors. | |||
kendo-color-info | #0058e9 | #0058e9 | Default: #0058e9 Computed: #0058e9 |
Description: The color for informational messages and states. | |||
kendo-color-success | #37b400 | #37b400 | Default: #37b400 Computed: #37b400 |
Description: The color for success messages and states. | |||
kendo-color-warning | #ffc000 | #ffc000 | Default: #ffc000 Computed: #ffc000 |
Description: The color for warning messages and states. | |||
kendo-color-error | #f31700 | #f31700 | Default: #f31700 Computed: #f31700 |
Description: The color for error messages and states. | |||
kendo-color-dark | get-base-hue( gray, 800 ) | #424242 | Default: get-base-hue( gray, 800 ) Computed: #424242 |
Description: The dark color of the theme. | |||
kendo-color-light | get-base-hue( gray, 100 ) | #f5f5f5 | Default: get-base-hue( gray, 100 ) Computed: #f5f5f5 |
Description: The light color of the theme. | |||
kendo-color-inverse | if( $kendo-is-dark-theme, $kendo-color-light, $kendo-color-dark ) | #424242 | Default: if( $kendo-is-dark-theme, $kendo-color-light, $kendo-color-dark ) Computed: #424242 |
Description: Inverse color of the theme. Depending on the theme luminance dark or light, it will be light or dark |
Charts Variables
The Chart Sass variables are specific to the Chart UI component. They do not affect other components.
Variable | Default Value | Computed Value | Value |
---|---|---|---|
kendo-series-a | if($kendo-enable-color-system, k-color( series-a ), get-base-hue( purple, 500 )) | #9c27b0 | Default: if($kendo-enable-color-system, k-color( series-a ), get-base-hue( purple, 500 )) Computed: #9c27b0 |
Description: The first base series color and its light and dark shades. | |||
kendo-series-b | if($kendo-enable-color-system, k-color( series-b ), get-base-hue( blue, 500 )) | #2196f3 | Default: if($kendo-enable-color-system, k-color( series-b ), get-base-hue( blue, 500 )) Computed: #2196f3 |
Description: The second base series color and its light and dark shades. | |||
kendo-series-c | if($kendo-enable-color-system, k-color( series-c ), get-base-hue( teal, 500 )) | #009688 | Default: if($kendo-enable-color-system, k-color( series-c ), get-base-hue( teal, 500 )) Computed: #009688 |
Description: The third base series color and its light and dark shades. | |||
kendo-series-d | if($kendo-enable-color-system, k-color( series-d ), get-base-hue( yellow, 500 )) | #ffeb3b | Default: if($kendo-enable-color-system, k-color( series-d ), get-base-hue( yellow, 500 )) Computed: #ffeb3b |
Description: The fourth base series color and its light and dark shades. | |||
kendo-series-e | if($kendo-enable-color-system, k-color( series-e ), get-base-hue( red, 500 )) | #f44336 | Default: if($kendo-enable-color-system, k-color( series-e ), get-base-hue( red, 500 )) Computed: #f44336 |
Description: The fifth base series color and its light and dark shades. | |||
kendo-series-f | if($kendo-enable-color-system, k-color( series-f ), get-base-hue( green, 500 )) | #4caf50 | Default: if($kendo-enable-color-system, k-color( series-f ), get-base-hue( green, 500 )) Computed: #4caf50 |
Description: The sixth base series color and its light and dark shades. | |||
kendo-series-1 | $kendo-series-a | #9c27b0 | Default: $kendo-series-a Computed: #9c27b0 |
Description: The series colors in order: base, light, dark, lighter, darker | |||
kendo-chart-major-lines | rgba( if($kendo-enable-color-system, k-color( on-app-surface, true ), if( $kendo-is-dark-theme, $kendo-color-white, $kendo-color-black )), .08 ) | rgba(0, 0, 0, 0.08) | Default: rgba( if($kendo-enable-color-system, k-color( on-app-surface, true ), if( $kendo-is-dark-theme, $kendo-color-white, $kendo-color-black )), .08 ) Computed: rgba(0, 0, 0, 0.08) |
Description: The color of the Chart grid lines (major). | |||
kendo-chart-minor-lines | rgba( if($kendo-enable-color-system, k-color( on-app-surface, true ), if( $kendo-is-dark-theme, $kendo-color-white, $kendo-color-black )), .04 ) | rgba(0, 0, 0, 0.04) | Default: rgba( if($kendo-enable-color-system, k-color( on-app-surface, true ), if( $kendo-is-dark-theme, $kendo-color-white, $kendo-color-black )), .04 ) Computed: rgba(0, 0, 0, 0.04) |
Description: The color of the Chart grid lines (minor). |