Default Theme

Apply the perfect look and feel to your apps with the styles supported by the Telerik and Kendo UI Default theme.

Elevation in the Telerik and Kendo UI Default Theme

The elevation system in the Telerik and Kendo UI Default theme enables you to easily define and customize shadows, allowing you to achieve effects like lift and depth and ensuring consistency and adaptability for your design needs.

This article explains how to configure the elevation values specifically in the Telerik and Kendo UI Default theme. To learn how the Telerik and Kendo UI design system implements elevation through elevation levels and shadow layers, see the Elevation Overview article.

Default Configuration

By default, the elevation in the Telerik and Kendo UI Default theme is configured with a set of predefined values, which are structured in the $kendo-elevation Sass map:

KeyValue
Variable: kendo-elevation
1
  • (0 2px 3px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.12))
2
  • (0 4px 6px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.12))
3
  • (0 6px 8px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.12))
4
  • (0 8px 10px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.12))
5
  • (0 10px 12px rgba(0, 0, 0, 0.16), 0 4px 16px rgba(0, 0, 0, 0.12))
6
  • (0 12px 14px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.12))
7
  • (0 14px 16px rgba(0, 0, 0, 0.24), 0 4px 16px rgba(0, 0, 0, 0.12))
8
  • (0 16px 18px rgba(0, 0, 0, 0.28), 0 4px 16px rgba(0, 0, 0, 0.12))
9
  • (0 32px 34px rgba(0, 0, 0, 0.32), 0 4px 16px rgba(0, 0, 0, 0.12))
Description: The global default Elevation map.

Usage

You can use the $kendo-elevation map as is or customize it to fit your specific design needs.

To use the predefined values, utilize either of the following approaches:

  • Use the Sass map—Import the theme and apply the desired elevation level to your element:

    @use 'sass:map';
    
    // First, import the Default theme.
    @import "@progress/kendo-theme-default/dist/all.scss";
    
    .my-element {
    box-shadow: map.get($kendo-elevation, 3); // Then, apply the default level 3 shadow to .my-element.
    }
    
  • Use custom CSS properties—Utilize the k-elevation() function, which returns a unique CSS variable:

    // First, import the Default theme.
    @import "@progress/kendo-theme-default/dist/all.scss";
    
    .my-element {
    box-shadow: k-elevation(3); // Apply default level 3 shadow to .my-element.
    }
    

Customization

Customizing the $kendo-elevation Sass map allows you to extend the available elevation levels and tailor them to your specific requirements by modifying existing values, creating new values, or removing existing values.

Modifying Existing Values

If most of the default elevation values match your design needs, you don't need to redeclare all the values in the Sass map. Identify the elevation levels that need changes and modify them.

// Modify the elevation map before importing the theme.
$kendo-elevation: (
6: (
12px 16px 10px -2px rgba(0,0,0,0.75),  // For example, adjust elevation level 6.
0 4px 16px rgba(0, 0, 0, .12)
),
);

@import "@progress/kendo-theme-default/dist/all.scss";

Adding New Values

Adding new shadow intensity levels allows you to extend the elevation Sass map:

$kendo-elevation: (
10: (
0 34px 36px rgba(0, 0, 0, .34), // Add a new level 10 shadow intensity.
0 4px 16px rgba(0, 0, 0, .12)
)
);

@import "@progress/kendo-theme-default/dist/all.scss";

Removing Existing Values

To remove an existing shadow intensity level, set its value to null.

$kendo-elevation: (
3: null // Remove the level 3 value.
);

@import "@progress/kendo-theme-default/dist/all.scss";