Executing ng add @progress/kendo-angular-* will always register a theme in angular.json. This would normally be "kendo-theme-default" unless the styles section already contains a known theme.
In any case, the theme must be manually removed from angular.json if it is not desired - e.g. a custom theme is in use.
The schematic should register the styles only if there is no kendo-theme-* _package_ installed.
ng new test-project --style=scsscd test-projectng add @progress/kendo-angular-buttonsRemove the object containing "kendo-theme-default" from styles in angular.json (two in total):
{
"input": "node_modules/@progress/kendo-theme-default/scss/all.scss"
},
Add the following lines to src/styles.css:
@import "~@progress/kendo-theme-default/scss/all";
ng add @progress/kendo-angular-inputsangular.json now contains a reference to "kendo-theme-default"Adding the theme by default is a convenience feature that ensures that the components are immediately ready for use. It becomes a problem when a custom theme is in use.
The schematic doesn't detect this scenario and will add a theme anyway. This results in an increased bundle size and styling issues.
N/A
/cc @gyoshev @rkonstantinov
Update: The schematics have been updated to register the pre-built CSS files instead of SASS, improving build times and compatibility with IE.
Existing users are urged to replace the theme registration (2 instances) in angular.json with:
{
"input": "node_modules/@progress/kendo-theme-default/dist/all.css"
}
Update: Decided to drop the optional theme parameter as registering themes is a non-trivial task. For example, the user might be including styles for specific components, the file layout can be arbitrary, etc.
This limits the schematic to registering a theme only on first use, leaving the components in a fully functional state until the user decides to change or customize the theme. More importantly, it prevents the schematic from doing harm to existing projects.
Fixed to register theme only on first install. No styles will be imported if the project has a dependency to any of the@progress/kendo-theme-* packages.
Most helpful comment
Update: Decided to drop the optional
themeparameter as registering themes is a non-trivial task. For example, the user might be including styles for specific components, the file layout can be arbitrary, etc.This limits the schematic to registering a theme only on first use, leaving the components in a fully functional state until the user decides to change or customize the theme. More importantly, it prevents the schematic from doing harm to existing projects.