Skip to content

Commit 3d10dd1

Browse files
Merge dimodi-patch-1-css-k-body-3310 into production (#3312)
* docs(Common): Document the k-body CSS class * Update overview.md * Update knowledge-base/change-theme-runtime.md * Update styling-and-themes/overview.md * Update knowledge-base/change-theme-runtime.md * Update knowledge-base/change-theme-runtime.md * Update styling-and-themes/overview.md --------- Co-authored-by: Dimo Dimov <[email protected]>
1 parent ae972b0 commit 3d10dd1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

knowledge-base/change-theme-runtime.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ The following algorithm follows the commonly used approach to replace a CSS file
7777
document.getElementsByTagName("head")[0].appendChild(newLink);
7878
}
7979
````
80+
1. [Set the `k-body` CSS class to the `<body>` element in your app](slug:themes-overview#using-a-theme).
8081
1. Implement UI that triggers the JavaScript theme change. After the new CSS theme is loaded, refresh all Telerik components that use SVG or Canvas rendering, such as Barcodes, Charts, Gauges, and QR Codes.
8182

8283
> Make sure [the version number in the theme URL is compatible with the version of Telerik UI for Blazor](slug:themes-overview#compatibility-and-maintenance).

styling-and-themes/overview.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ You can explore and compare the built-in theme swatches on the [live Telerik UI
5858

5959
## Using a Theme
6060

61-
To register a theme, you must reference its stylesheet in the `<head>` of the web page. The exact project file that contains the `<head>` tag depends on the .NET version and the Blazor application type. See our [Getting Started guides](slug:blazor-overview#getting-started) for more information.
61+
To register a theme:
62+
63+
* Reference its stylesheet in the `<head>` of the web page. The exact project file that contains the `<head>` tag depends on the .NET version and the Blazor application type. See our [Getting Started guides](slug:blazor-overview#getting-started) for more information.
64+
* Set the `k-body` CSS class to the root container of your app, which is normally the `<body>` element. This class applies default text color and background color to generic web content and is especially important when using dark theme swatches.
6265

6366
There are three ways to load a Telerik theme, in terms of physical CSS file location. Note that each option provides access to a different number of theme swatches.
6467

0 commit comments

Comments
 (0)