This is a migrated thread and some comments may be shown as answers.

blazor telerik custom theme

3 Answers 144 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
khashayar
Top achievements
Rank 1
Veteran
khashayar asked on 16 Oct 2019, 02:21 PM
hi, i was wondering to know if there is a way to give custom style to each telerik component individually i have already tried using class and id but some of components do not accept class or id i also  tried this https://themebuilder.telerik.com/blazor-ui but unfortunately  there is a very big problem with colors and sometimes they don't match and will result in an awkward component which most parts has same color 

3 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 17 Oct 2019, 05:56 AM

Hello,

The concept of our themes is that components always match each other, and to that end the themes use shared "components" that have the same classes and styling - for example headers, titlebars, buttons, etc.

The theme builder operates by using a few base variables and extracts further colors from them. It is up to you to choose the initial colors and you can preview the results on the right hand side. You can then manually tweak things for better precision.

If you want to implement tweaks per control, you can inspect the rendered HTML and see the available classes. Usually the component wrapping element has a class like k-treeview (for the treeview, for example) that you can cascade through. Most components have a Class attribute and if some doesn't, you can always cascade through a parent class from your layout.

If you start implementing CSS overrides per component, you may find the following useful:

Regards,
Marin Bratanov
Progress Telerik

 UI for Blazor
0
khashayar
Top achievements
Rank 1
Veteran
answered on 17 Oct 2019, 07:15 AM

thank you for your answer but i wanna know if inspecting an element to copy and use its class in code is  a correct way or not i have always felt this is an awkward way to style an element  

0
Marin Bratanov
Telerik team
answered on 17 Oct 2019, 07:55 AM

Hi,

Inspecting the elements and creating CSS rules that override our built-in appearance is the correct approach for small tweaks or per-instance alterations.

For changing the overall look of all the components, I recommend creating a custom theme. You can still add tweaks to it.

 

Regards,
Marin Bratanov
Progress Telerik

 UI for Blazor
Tags
General Discussions
Asked by
khashayar
Top achievements
Rank 1
Veteran
Answers by
Marin Bratanov
Telerik team
khashayar
Top achievements
Rank 1
Veteran
Share this question
or