Handling Breaking Changes in the Variables
Environment
Product Version | 02/09/2023 |
Product | ThemeBuilder |
Description
How can I handle breaking changes in the variables when migrating an existing ThemeBuilder project to the latest version of the Telerik and Kendo UI themes?
I created a new project that uses the latest Telerik and Kendo UI themes as a base. Then I imported the metadata of the project that I want to migrate. However, the variables that I modified in the migrated project are created as custom variables in the new project and they do not affect the Telerik and Kendo UI theme anymore.
Solution
Breaking changes in the names of the variables do not allow the direct migration of a project that uses a previous version of the Telerik and Kendo UI themes to a new project that uses the latest version of the themes. The solution is to map the Telerik and Kendo UI theme variables from your old project to the variables in the new project:
-
Rename the variables in the project that you want to migrate and make them match the variable names in the latest Telerik and Kendo UI themes:
- Export the metadata of the project that you want to migrate to a new version of the Telerik and Kendo UI themes.
- Extract the
.zip
file to a local folder and open thedata.json
file in a text editor. - Expand the
variables
object that contains an array of all variables from your project. - Look for any differences in the variable names between the older project version and the latest. For example, to identify the variable name changes in version 6.0.0 of the themes, see the change log.
-
Change the names of these variables to match the new ones. For example, if the variable name in your older project is
$primary
and in the latest Telerik and Kendo UI theme the same variable name is changed to$kendo-color-primary
, replace all$primary
occurrences in the file with$kendo-color-primary
.All breaking changes between 5.10 and 6.0 are described in the change log.
-
Import the migrated metadata.
- Create a new ThemeBuilder project.
- Create a ZIP file that contains the
data.json
file that you modified. - From the newly created ThemeBuilder project, navigate to the toolbar and select the project menu dropdown.
- Select Import Metadata.
- Upload the ZIP file with the metadata of the project that you want to migrate.
After refreshing the app, you can continue with your styling.