Kendo button theme

1 Answer 22 Views
Button Styling
Vaishaly
Top achievements
Rank 1
Vaishaly asked on 27 May 2024, 06:28 AM | edited on 27 May 2024, 06:29 AM
I am changing the application theme dynamically on runtime, so when i use kendo button with property "themeColor="primary" , its not taking the dynamic theme colour of the application.

Application theme is default-ocean-blue, but its taking orange colour for button menu.

1 Answer, 1 is accepted

Sort by
0
Yanmario
Telerik team
answered on 29 May 2024, 01:09 PM

Hi Vaishaly,

Thank you for the provided details.

We are not sure how the theme was changed. I tried to replace the CDN of the theme as described in the following article:

https://www.telerik.com/kendo-angular-ui/components/knowledge-base/change-theme-dynamically/

but the primary color was changed according to the theme. Here is an example:

https://stackblitz.com/edit/angular-mfcnsr

Please make sure that the installed Kendo theme versions are compatible with the installed Kendo packages:

https://www.telerik.com/kendo-angular-ui/components/changelogs/kendo-angular-ui/

Regards,
Yanmario
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources
Vaishaly
Top achievements
Rank 1
commented on 30 May 2024, 06:05 AM

Hi Yanmario,

Thanks for your explanation.

In your example on button click you are changing the theme, but my requirement  is i have to set a new theme based on the environment in which the application is running (eg: local, dev, production).

So for that i tried to change/set the theme in app.component.ts based on environment, and i am expecting wherever component I use kendo component  with "themeColor="primary" it should apply the theme accordingly (theme set as per in app.component.ts).

Not sure that this the correct approach. Kindly help me to get this scenario to work.

Yanmario
Telerik team
commented on 31 May 2024, 06:48 AM

Hi Vaishaly,

Changing the themes depending on the environment would be more towards configuring how Angular handles the styles depending on the environment. I would suggest checking out angular.json config which should provide you the option to load different stylesheets depending on the environment and also researching this matter from some online resources like:

https://medium.com/@anjnkmr/configuring-angular-scss-for-different-environments-fa5e3857ca5c

https://github.com/angular/angular-cli/issues/4685

https://medium.com/@pedrorolo/angular-setting-angular-json-b485dedc29d7

I hope this helps.

Regards,
Yanmario
Progress Telerik
Tags
Button Styling
Asked by
Vaishaly
Top achievements
Rank 1
Answers by
Yanmario
Telerik team
Share this question
or