Bootstrap Theme

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

Elevation in the Telerik and Kendo UI Bootstrap Theme

The elevation system in the Telerik and Kendo UI Bootstrap 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 Bootstrap 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 Bootstrap theme is configured with a set of predefined values, which are structured in the $kendo-elevation Sass map:

KeyValue
Variable: kendo-elevation
1
  • ((0px 1px 2px rgba(0, 0, 0, 0.038),))
2
  • ((0px 2px 7px rgba(0, 0, 0, 0.075),))
3
  • ((0px 4px 10px rgba(0, 0, 0, 0.1),))
4
  • ((0px 6px 13px rgba(0, 0, 0, 0.125),))
5
  • ((0px 8px 16px 0px rgba(0, 0, 0, 0.15),))
6
  • ((0px 11px 24px 0px rgba(0, 0, 0, 0.159),))
7
  • ((0px 14px 36px 0px rgba(0, 0, 0, 0.168),))
8
  • ((0px 16px 48px 0px rgba(0, 0, 0, 0.176),))
9
  • ((0px 18px 60px 0px rgba(0, 0, 0, 0.185),))
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 Bootstrap theme.
    @import "@progress/kendo-theme-bootstrap/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 Bootstrap theme.
    @import "@progress/kendo-theme-bootstrap/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: (
10px 10px 5px 0px rgba(0,0,0,0.159),// For example, adjust elevation level 6.
),
);

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

Adding New Values

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

$kendo-elevation: (
10: (
0px 20px 72px 0px rgba(0, 0, 0, 0.194), // Add a new level 10 shadow intensity.
)
);

@import "@progress/kendo-theme-bootstrap/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-bootstrap/dist/all.scss";