Under Review
Last Updated: 26 Jun 2019 14:02 by ADMIN
Robert
Created on: 04 Jun 2019 17:16
Type: Feature Request
1
Support for Multiple Themes
Is there a plan in the future to support multiple themes when using Kendo components. I can currently implement multiple themes on custom components but this is not possible on Kendo components because they import variables directly from SCSS variables in the stylesheet. Due to the file bundling that takes place in React it is impossible to import two SCSS files with the same variable names. The second import will always override the first file. This could be avoided by using a css in javascript solution(e.g. styled-components). This would allow the user to pass in multiple theme objects by using react props. Is there any plan to migrate to a more modern solution for handling styles with Kendo components.
1 comment
ADMIN
Stefan
Posted on: 05 Jun 2019 09:57
Hello, Robert,

Currently, a styled component can be used with computed props. I made an example showcasing this:

https://stackblitz.com/edit/react-gjjqct?file=app/main.jsx

Also, multiple themes can be loaded with CSS.

This will require having two separate CSS files for the two different themes.

Then based on the variable in the state, the linked CSS can be changed.

Please check the following links suggesting how this can be achieved:

https://stackoverflow.com/questions/28386125/dynamically-load-a-stylesheet-with-react

https://forums.meteor.com/t/load-dyanmic-css-file-in-react/29760

Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items